RadarTrek
Home/Glossary/Function
JavaScript

Function

A reusable block of code that takes input, does something, and can return a result.

Reviewed by the RadarTrek editorial team · June 2026

A function packages up a sequence of instructions so you can run it repeatedly without rewriting the logic. Functions can accept parameters (inputs) and return a value (output). They're the basic unit of reuse in JavaScript and almost every other programming language.

Why it matters

  • Functions are how you avoid repeating yourself — write the logic once, call it everywhere.
  • Most bugs are easier to find when logic is broken into small, well-named functions.
  • React components are themselves functions — understanding functions is a prerequisite for React.

Where to learn this

🎓

Functions in JavaScript

JavaScript Fundamentals course

This is the exact lesson that covers this term in depth — with examples, diagrams, and a hands-on exercise.

Related terms

RadarTrek Intel — monthly score updates

We track 40+ tools so you don't have to. Score changes, new tools, and new guides — once a month, no spam.