Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 358 Bytes

without.md

File metadata and controls

16 lines (12 loc) · 358 Bytes
title tags
without
array,beginner

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));
without([2, 1, 2, 3], 1, 2); // [3]