Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove element from array javascript

//using filter() method => it returns a new array
data = [1, 2, 3, 4, 5, 6];
let filteredData = data.filter((i) => {
    return i > 2
});
console.log(filteredData) // [3, 4, 5, 6]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #element #array #javascript
ADD COMMENT
Topic
Name
5+5 =