Skip to content

Commit b465551

Browse files
committed
Functions
1 parent 55cee59 commit b465551

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Functions & Methods/demo.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
// Arrow function
3+
const add=(a,b)=>{
4+
return a+b;
5+
}
6+
console.log("Addition is "+" "+add(2,3));
7+
8+
// Function declaration
9+
function add1(c,d){
10+
return c+d;
11+
}
12+
console.log("Addition is "+" "+add1(5,3));
13+
14+
// Function expression
15+
const add2=function(x,y){
16+
return x+y;
17+
}
18+
console.log("Addition is "+" "+add2(2,2));
19+
20+

0 commit comments

Comments
 (0)