Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

splice in javascript

The splice() method adds and/or removes array elements.
The splice() method overwrites the original array.
array.splice(index, howmany to remove, item1, ....., itemX)
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.splice(2, 1, "Lemon", "Kiwi");
//Banana,Orange,Lemon,Kiwi,Mango
 
PREVIOUS NEXT
Tagged: #splice #javascript
ADD COMMENT
Topic
Name
2+7 =