forked from codehouseindia/Everything
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.js
More file actions
38 lines (37 loc) · 830 Bytes
/
function.js
File metadata and controls
38 lines (37 loc) · 830 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
#https://www.facebook.com/permalink.php?story_fbid=623985158490864&id=100026381556272
# suscribed by chandresh joshi
// Anonymous function
// function (){
// alert("no name function")
// }
// named function
// function name(){
// alert("name function")
// }
// name();
//function expression
// var test= function (){
// alert("no name function")
// }
// test();
//immediate invoke function
// (function(){
// console.log('immediate invoke function')
// })
// ();
//function closure
function outer(){
var out='hello in a outer function';
document.write(out+'<br/>')
function inner(){
var inn="in a inner function"
document.write(inn+'<br/>')
}
return inner()
}
//Parameter in function
outer()
function add(n1,n2){
console.log("the sum is :",n1+n2)
}
add(10,20)