Dave’s Brain
Home
Search
Browse
Recent
Keywords
Other sites
Feedback
Sign in
Random
Crawlers
Programming Tips
- How can I delete an element from a javaScript array?
Date:
2017nov15
Language:
javaScript
Keywords:
remove
Q.
How can I delete an element from a javaScript array?
A.
To delete element 25 from array a
a
.
splice
(
25
,
1
);
Recall, array indexes are zero-based.
delete
a
[
25
];
// WRONG
... only sets it to undefined