-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray.js
More file actions
30 lines (19 loc) · 683 Bytes
/
Copy patharray.js
File metadata and controls
30 lines (19 loc) · 683 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
let arr=Array(2,3,4,2)
// console.log(arr[0]);
// console.log(Array.isArray(2));//Returns true if it is array.
// let val=arr.indexOf(4)
// console.log(val)//It will return the index of 4
//Modifying arrays
// arr.push(09)
// console.log(arr);//Push the no at the end
// arr.unshift(89)
// console.log(arr);//Push the no at starting
// arr.pop(9)//It will remove the no from the array.
// console.log(arr);
// arr.splice(0,3)
// console.log(arr);//it will remove the no from the 1st index to the 3rd index.
// arr.reverse()
// console.log(arr)//It will reverse the array.
// arrr=Array(1,1,1)
// arr=arr.concat(arrr)
// console.log(arr);//It will concat the arr to arrr.