I have an array like this:
let arr = ['liverpool', 'arsenal', 'man utd', 'chelsea', 'tottenham', 'crystal palace', 'madrid', 'barcelona'];
and I want to remove items, let's say 'arsenal'
and 'chelsea'
, but this needs to be dynamic.
I have tried the following, where items
is an array but unfortunately it didn't work:
function removeItems(items) {
arr.filter(item => {
return !arr.includes(items)
});
}
removeItems(['arsenal', 'chelsea']);