- Function Declaration → Hoisted, can be called before definition.
- Function Expression → Not hoisted, assigned to a variable.
Example:
// Declaration
function greet() { return "Hello"; }
// Expression
let sayHi = function() { return "Hi"; };
Example:
// Declaration
function greet() { return "Hello"; }
// Expression
let sayHi = function() { return "Hi"; };
Leave a Reply