Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove element from array by name javascript

var arr = ['three', 'seven', 'eleven'];

// Remove item 'seven' from array
var filteredArray = arr.filter(function(e) { return e !== 'seven' })
//=> ["three", "eleven"]

// In ECMA6 (arrow function syntax):
var filteredArray = arr.filter(e => e !== 'seven')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #element #array #javascript
ADD COMMENT
Topic
Name
7+9 =