Function Expressions
Function Expressions
Functions can be stored in variables.
const greet = function(){
console.log("Hello");
};
greet();
Call Function
greet();
Output:
Hello
Difference from Normal Function
Function Declaration
function greet(){
console.log("Hello");
}
Function Expression
const greet = function(){
console.log("Hello");
};
Both work similarly.