-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.js
More file actions
44 lines (33 loc) · 890 Bytes
/
Copy pathfunction.js
File metadata and controls
44 lines (33 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// c();
// b();
// function statement or function declaration
// function c(){
// var a=10;
// console.log(a);
// }
// // function expression
// var b=function(){
// console.log("Hello kaku");
// }
// Anonymous function-->function withous a name it is used to assigned value to the variable like in function expression
// function (){
// }
// Named function expression
// var c=function xys(){
// console.log("Hello bad");
// }
// c();
// xys(); //it gives an error because xys() is not create in global scope it is created in local scope so its value is not assigned in outside the scope but it can be assigned in local scope
// First class function
// var c=function c(){
// console.log('Hello')
// }
// function xyz(){
// }
// c(xyz)
// (function(){
// console.log( "hello");
// })();
//arrow function
var arrow=(a,b)=>console.log(a+b);
arrow(5,6);