Skip to content

Commit e7918e4

Browse files
feat: add function expression
1 parent 79511cc commit e7918e4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
INFO: What is a Function Expression ?
3+
A function expression is when you assign a function to a variable. Unlike fucntion declarations, function expressions are not hoisted, and the function can be anonymous or named.
4+
*/
5+
6+
// Syntax
7+
const variableName = function(parameters) {
8+
console.log("functiontion epxression");
9+
};
10+
11+
// Example
12+
const greet = function(name) {
13+
console.log(`Hello ${name}!`);
14+
};
15+
greet("Rafay");

0 commit comments

Comments
 (0)