FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JsArrayFunctionExpOne/Scripts/JsScript.js at master · AmarjitSinghCodeHub/JsArrayFunctionExpOne · GitHub
AmarjitSinghCodeHub
/
JsArrayFunctionExpOne
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JsArrayFunctionExpOne
/
Scripts
/
JsScript.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (26 loc) · 928 Bytes
Breadcrumbs
JsArrayFunctionExpOne
/
Scripts
/
JsScript.js
Copy path
File metadata and controls
39 lines (26 loc) · 928 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
const
btn
=
document
.
querySelector
(
"#btn"
)
;
const
msg
=
document
.
querySelector
(
"#divMsg"
)
;
var
arr
=
[
22
,
34
,
35
,
76
,
78
]
;
var
arr2
;
var
arr3
;
btn
.
addEventListener
(
"click"
,
(
)
=>
{
//unshift();
//arr.unshift(40); // adds item at first of the array
// Shift()
//arr.shift(); // removes item from first index onwards
// arr.shift(); // will remove next item
// arr.shift();
// arr.shift();
// arr.shift();
// arr.shift();
// arr.pop(); // removes item from the end of array
// arr.pop();
// arr.push(1000); // adds item at the end of array
// arr.push(22);
//arr.reverse(); // reverse the array value.
arr2
=
arr
;
// ref copy
arr3
=
[
...
arr
]
;
// value copy
arr
.
reverse
(
)
;
// value of arr3 will not reverse.
//arr3.reverse();
msg
.
innerHTML
=
`value of arr2 :
${
arr
}
<br/> value of arr2 :
${
arr2
}
<br/> value of arr3 :
${
arr3
}
`
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL