Introduction
In JavaScript ES6, we may wish to remove items from an array.
We'll examine how to remove an item from an array in this tutorial.
Remove an item from an array in ES6
To remove specific item from an array in ES6 we need to use array.filter(...)
function.
Using array.filter(...)
we simple remove unwanted items.
Note that: this method generates a new array rather than altering the existing one.
Conclusion
To remove specific item from an array in ES6 we can use array.filter(...)
method to filter unwanted items and generate a new array with less elements.
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}