Skip to content

Commit 525f1a8

Browse files
committed
EP-13 | FIRST CLASS FUNCTIONS 🔥ft. Anonymous Functions
1 parent 2e8c92c commit 525f1a8

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
a()
2+
// Function Statement OR Function Declarations
3+
function a () {
4+
console.log("a called");
5+
}
6+
7+
8+
// Function Statement
9+
function b () {
10+
console.log("b called");
11+
}
12+
b()
13+
14+
15+
// Function Expression
16+
const c = function (param1) {
17+
return function xyz () {
18+
19+
}
20+
}
21+
console.log(c());
22+
23+
24+
// Anonymous Function is a function without a name
25+
// function () {
26+
27+
// }
28+
29+
30+
// First Class Functions - Ability to used like values
31+
// First Class CItizens
32+
33+
// Named Function Expression
34+
35+
// Difference between Parameters & Arguments ?
36+
37+
// First Class Functions - Ability to be used like values
38+
// & First Class Citizens -Ability to be used like values makes this function first class citizens
39+
// when they are treated as a value passesd into another function or returned from another function,
40+
// so this is known as a first class function.
41+
42+
// Arrow Functions - ES6
43+
const xyz = () => {
44+
console.log("hello arrow function");
45+
}
46+
xyz()

0 commit comments

Comments
 (0)