-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
33 lines (19 loc) · 794 Bytes
/
main.js
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
// function Declaration
funcDeclarationDemo(); // function will call
function funcDeclarationDemo(){
console.log("function declaration");
}
funcDeclarationDemo(); // function will call
// function expression
// using let
//funcExpressionLet(); // Cannot access 'funcExpressionLet' before initialization. // it will throw run time exception
let funcExpressionLet=function(){
console.log("function expression using let");
}
funcExpressionLet(); // function will call
// using var
//funcExpressionVar(); //funcExpressionVar is not a function // it will throw run time exception
var funcExpressionVar=function(){
console.log("function expression using var");
}
funcExpressionVar(); // function will call