From e96393019c10ac004c96743fc9aa909042ceea16 Mon Sep 17 00:00:00 2001 From: taltmann42 Date: Fri, 15 Dec 2017 00:23:10 +0100 Subject: [PATCH] Create array-without.md --- snippets/array-without.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 snippets/array-without.md diff --git a/snippets/array-without.md b/snippets/array-without.md new file mode 100644 index 000000000..353d1308e --- /dev/null +++ b/snippets/array-without.md @@ -0,0 +1,9 @@ +### Array without + +Filters out array elements if they are included in the given `values` arguments + +```js +const without = ((arr, ...values) => arr.filter(x => !values.includes(x))) + +//without([2, 1, 2, 3], 1, 2); -> [3] +```