-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.js
More file actions
69 lines (53 loc) · 995 Bytes
/
function.js
File metadata and controls
69 lines (53 loc) · 995 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// function
// syntax
// function name (){}
function box1 (){
var a = 10;
var a = 30;
console.log(a);
var a = 40;
var f = 50;
console.log(a+f)
}
box1();
// let
let b = 25;
m = 35;
console.log(m);
// const
const c = "Rijesh Ramadas"
console.log(c)
// variables
var a = 40;
var f = 50;
console.log(a+f)
}
box1();
// function statement and decleration -- parametre & argument
function box2 (hi){
console.log(hi);
}
box2("hellow world")
// function expression or anonymous function - method 2
let js=function box3 (hi){
console.log(hi);
}
js("hellow world")
//
let ja=function (hi){
console.log(hi);
}
ja("hellow world");
// immediate invoke function expression
(function (life){
console.log(life);
})("java script");
// Arrow Function ()=>{}
let aro = (out)=>{console.log(out)}
aro ("arrow function")
//
var sayhellow = ()=>console.log("Hellow fruit");
sayhellow();
//
var myfavfruit = ()=> console.log("My favourite fruit is mango");
myfavfruit();