TechLivoasis
Simplifying Tech, Elevating Life
Search This Blog
2023/07/25
How to emply array
var
arrayList
=
[
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
];
console
.
log
(
"Before:"
,
arrayList
)
arrayList
.
splice
(
0
,
arrayList
.
length
)
console
.
log
(
"After:"
,
arrayList
)
output:
Before: [ 'a', 'b', 'c', 'd', 'e', 'f' ] After: []
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment