-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript11.js
78 lines (59 loc) · 1.51 KB
/
script11.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
//push()
// 0 1 2 3
let names = ["chinmay","shirish","rajesh","satish"]
// action
// return
// Gym
// Excercise
// Health
let q1 = names.push("sanjay")
console.log(q1)
console.log(names)
//unshift()
// 0 1 2 3
let fruits = ["apple","mango","banana","oranges"]
console.log(fruits)
let q2 = fruits.unshift("papaya")
console.log(q2)
console.log(fruits)
//pop()
let vegetables = ["carrot","brinjal","cabbage","cauliflower"]
let q3 = vegetables.pop()
console.log(q3)
console.log(vegetables)
//shift()
let city = ["pune","nagpur","bangalore","chennai"]
let q4 = city.shift()
console.log(q4)
console.log(city)
// push() , pop() , unshift() , shift()
// includes
// 0 1 2 3
let country = ["india","pakistan","srilanka","china"]
let q5 = country.includes("india")
console.log(q5)
let q6 = country.includes('India')
console.log(q6)
//reverse()
country = ["india","pakistan","srilanka","china"]
let q7 = country.reverse()
console.log(q7)
// concat()
let arr = [11,22,33]
let arr2 = [44,55,66]
let arr3 = arr.concat(arr2)
console.log(arr3)
// join()
let info = ["chinmay","deshpande",7709192441]
let q8 = info.join(" ") // chinmay-deshpande-7709192441
console.log(q8)
// at()
// 0 1 2 3
country = ["india","pakistan","srilanka","china"]
let q9 = country.at(2)
console.log(q9)
// indexOf()
// 0 1 2 3 4
let q22 = [22,33,44,55,66]
let q10 = q22.indexOf(33)
console.log(q10)