Skip to content

Commit 0907b46

Browse files
committed
function and arrow function
1 parent 740a49b commit 0907b46

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

revision/rev2.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,27 @@ function abcd(){
2020
let f=5 // braces scoped
2121
console.log(e,f,d)
2222
}
23-
console.log(e,f)
23+
2424

2525
}
2626
abcd()
2727

2828

2929
// var add itself in window obj which is highly insecure for data privacy thats why let and const
30-
//were introduced which if defined in script.js will not add themself in window obj
30+
//were introduced which if defined in script.js will not add themself in window obj
31+
32+
//simple function
33+
let fun=function(){
34+
console.log("one way of defining function")
35+
}
36+
fun()
37+
38+
function xyz(){
39+
console.log("second way of defining function")
40+
}
41+
xyz()
42+
//arrow function
43+
let erg=()=>{
44+
console.log("this is arrow function")
45+
}
46+
erg()

0 commit comments

Comments
 (0)