-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray.js
More file actions
63 lines (50 loc) · 1.29 KB
/
Copy patharray.js
File metadata and controls
63 lines (50 loc) · 1.29 KB
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
//let student=["sandip","rohit","Rahul"]
//let std=["bahrat","jes","los"]
//console.log(student)
//student.push("jack")
//console.log(student)
//student.pop()
//console.log(student)
//delete student[0]
//unshift-puts the elements in beginning of the array
//student.unshift("asif","kushal")
//console.log(student)
//shift-remove the first element from the array
//student.shift()
//console.log(student)
//Join-join the elements and covert into string
//console.log(student.join())
//concat-merge the elements of two or more array
//stdd=student.concat(std)
//console.log(stdd)
//reverse-reverse the array
//console.log(student.reverse())
//slice-returns the portion of the array
//console.log(student.slice(0,2))
//fill
//console.log(student.fill("rock",0,2))
//destructing assignment
//let planets=["sun","moon","venus"]
//let shad=["jdj","ddd","dsds"]
//sr=planets.concat(shad)
//console.log(sr)
//let [planet1,planet2,planet3]=planets
//console.log(planet1,planet2,planet3)
//const[planet1,planet2,...rest]=planets
//console.log(rest)
let student={
name:"hari",
age:20,
address:"ktm",
lo:0,
};
let student2={
name:"JWE",
age:33,
}
//const{name,age}=student
//console.log(name,age)
//const{name,...others}=student
//console.log(others)
let a={...student, ...student2}
console.log(a)