Files
30-seconds-of-code/snippets/array-without.md
2017-12-15 00:23:10 +01:00

224 B

Array without

Filters out array elements if they are included in the given values arguments

const without = ((arr, ...values) => arr.filter(x => !values.includes(x)))

//without([2, 1, 2, 3], 1, 2); -> [3]