-
Notifications
You must be signed in to change notification settings - Fork 0
/
day7.js
112 lines (72 loc) · 1.48 KB
/
day7.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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
///function
function intro(){
console.log("hello all");
console.log("i m a human");
}
intro()
function addition(x,y){
return x+y;
}
const result=addition(5,5)
console.log("result is",result);
function print(...parameter){
return parameter;
}
console.log(print(200,400,600))
const user={
username:"karan",
id:34
}
function handleobject(anyobj){
console.log(`username is ${anyobj.username} and id is ${anyobj.id} `)
}
//handleobject(user)
handleobject({
username:"karan singh",
id:26
})
//scopes
const user1={
username:"rohit",
id:67,
address:"13 nagar",
welcomemessge: function(){
console.log(`welcome to thew website ${this.username}`)
}
}
user1.welcomemessge()
function chai(){
let username1="karan singh"
console.log(this.username1)
}
chai()
//second type of func declaration
const chai1=function (){
let username1="karan singh"
console.log(this.username1)
}
chai1()
//third type of func declaration
const chai2=()=>{
let username1="karan singh"
console.log(this.username1)
}
chai2()
const addition1=(n1,n2)=>{
return n1+n2;
}
console.log(addition1(2,2))
//rerurn keyworld mot required in parameters
const add1=(num3,num4)=>(num3+num4)
console.log(add1(5,8))
//immediately invoked function expressions(IIFE)
function chai55(){
console.log("hello")
}
chai55()
// ( function chai5(){
// console.log("hello");
// } )();
( (name)=>{
console.log("db-bank")
} )("test para");