Chapter 3
Chapter 3
Chapter 3
Functions
Defining a function
A function definition is a regular binding where the value of the binding is a
function. For example, this code defines square to refer to a function that
produces the square of a given number:
const square = function(x) {
return x * x;
};
console.log(square(12));
// → 144
Defining a function
Function Example
Function Execution
Merely defining a function does not result in execution of
the
function; it must be called for execution
Actual Vs formal arguments