Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove certain element from array

//Defining an array
let arr = ['One', 'Two', 'Three'];
let srch = 'Two'; //This is the element we want to search and remove
let index = arr.indexOf(srch); //Find the index in the array of the search parameter
arr.splice(index, 1); //Splice the array to remove the located index
Source by worcraft-algeria-dz.com #
 
PREVIOUS NEXT
Tagged: #javascript #remove #element #array
ADD COMMENT
Topic
Name
5+2 =