Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove element from array

const cars = ['farrari', 'Ice Cream'/* It is not an car */, 'tata', 'BMW']

//to remove a specific element
cars.splice(colors.indexOf('Ice Cream'), 1);

//to remove the last element
cars.pop();
 
PREVIOUS NEXT
Tagged: #javascript #remove #element #array
ADD COMMENT
Topic
Name
5+8 =