Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array remove middle

// example (remove middle element(s) in the array)
let yourArray = ["aaa", "bbb", "ccc", "ddd"];
yourArray.splice(2,1); // yourArray = ["aaa", "bbb", "ddd"]

// syntax:
// <array-name>.splice(<start-index>,<number-of-elements-to-remove>);
 
PREVIOUS NEXT
Tagged: #javascript #array #remove #middle
ADD COMMENT
Topic
Name
9+4 =