-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathes6.js
More file actions
58 lines (42 loc) · 821 Bytes
/
es6.js
File metadata and controls
58 lines (42 loc) · 821 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
function greet(name="default", age=12){
console.log(name,age)
}
greet("sujay",12333);
//templet iterates
let one ="js"
console.log(`sujay`
,`${one}`)
//destructuring
//-array
//-objects
const ourArray = ["java",123]
const [age,na]=ourArray
console.log(na,age)
const obj ={
nam:"suja",
ag:12
}
const{ag,nam}=obj
console.log(nam,ag)
//arrow function
const greaat=()=>{
console.log("sujya")
}
greaat();
// this key word is very imp
const objee ={
name:"sujay",
hello:function(){
console.log(this);
},
another:{
name:"java",
greeeet:function(){
console.log("another",this)
}
}
};
console.log("outter",this);
//when we
objee.hello();
objee.another.greeeet();