30 seconds of code

  Back to Home

without

arraybeginner

Filters out the elements of an array, that have one of the specified values.

Use Array.prototype.filter() to create an array excluding(using !Array.includes()) all given values.

const without = (arr, ...args) => arr.filter(v => !args.includes(v));