Write reusable functions, understand function scope, closure, and the difference between function and block scope. Functions are the building blocks of modular code.
function add(a, b) {
return a + b;
}
console.log(add(3, 5));
const multiply = (x, y) => x * y;
console.log(multiply(4, 5));Write reusable functions, understand function scope, closure, and the difference between function and block scope. Functions are the building blocks of modular code.
function add(a, b) {
return a + b;
}
console.log(add(3, 5));
const multiply = (x, y) => x * y;
console.log(multiply(4, 5));