File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Example/Function/Arrow functions Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ // basic Arrow funciton
2+
3+ const greet = ( ) => console . log ( "Good Morning" ) ;
4+
5+ greet ( ) ;
6+
7+ // use arg..
8+
9+ const info = ( Name , Age ) => {
10+ console . log ( `My name is ${ Name } and age is ${ Age } ` ) ;
11+ }
12+
13+ info ( "Nishant" , 12 ) ;
14+
15+ // return type + arg.
16+
17+ let addNumbers = ( a , b ) => {
18+ let result = a + b ;
19+ return result ;
20+ }
21+ let sum = addNumbers ( 5 , 8 ) ;
22+ console . log ( "The sum is " + sum ) ;
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Document</ title >
7+ < script src ="Arrow.js "> </ script >
8+ </ head >
9+ < body >
10+
11+ </ body >
12+ </ html >
You can’t perform that action at this time.
0 commit comments