Functions are the most important concept in JavaScript — possibly in all of programming. They let you package logic into a named, reusable unit that you can call anytime, anywhere. Without functions, every program would be a single enormous, unmaintainable block of code. In this lesson you'll learn every way to write a function in JS: declarations, expressions, arrow functions, closures, and higher-order functions.
1-B 2-B 3-B 4-B | 5 function 6 => 7 = const square = n => n * n; 8 = function greet(name){ return `Hello ${name}`; } 9 = log shows output; return hands the value to the caller | 10 = 15 (b defaults to 10)