Key Ideas
1What is a Function?. A function is a named, reusable block of code that performs a specific task. You define it once and call it as many times as you need. Think of a function as a recipe:...
2Function Declarations. The classic way to create a function uses the function keyword, followed by a name, parentheses for parameters, and a block body. The defining feature of declarations ...
3Function Expressions. A function expression assigns an anonymous (or named) function to a variable. Unlike declarations, function expressions are not hoisted — you can only call them after ...
4Arrow Functions (ES6). Arrow functions, introduced in ES2015, provide a shorter syntax for writing function expressions. They use the => token instead of the function keyword. Beyond brev...
5Parameters & Arguments. Parameters are the named placeholders in the function definition. Arguments are the actual values you pass when calling the function. JavaScript is flexible: you can p...