Using Array.splice for Removing Items in Javascript


Remove or replace items in an array using splice.

Source Code

let items = ['item1', 'item2', 'item3'];
items.splice(1, 1); // Removes 'item2'
console.log(items);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments