How to remove an item from an Array in JavaScript

PHOTO EMBED

Sun Oct 31 2021 20:05:52 GMT+0000 (UTC)

Saved by @arielvol #javascript

const items = ['a', 'b', 'c', 'd', 'e', 'f']
const valueToRemove = 'c'
const filteredItems = items.filter(item => item !== valueToRemove)
// ["a", "b", "d", "e", "f"]
content_copyCOPY

https://flaviocopes.com/how-to-remove-item-from-array/