From 9dfb596fe5ba2f716b8c8ae993f42164b25e343b Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 10 Aug 2021 23:35:33 +0200 Subject: [PATCH 1/2] Add FAQ to the readme Fixes #10 --- readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/readme.md b/readme.md index d0c8ff4..c8e91fb 100644 --- a/readme.md +++ b/readme.md @@ -33,6 +33,12 @@ Type: `unknown[]` Arrays of values to exclude. +## FAQ + +### What is the time complexity of the algorithm? + +[Read here.](https://github.com/sindresorhus/array-differ/issues/10) + ---
From ccc7fceca4de3446f0bca211ff5cd8240b9d64a5 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Tue, 14 Sep 2021 22:06:38 +1200 Subject: [PATCH 2/2] Minor tweak (#15) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f1877e0..7f4c0e1 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ export default function arrayDiffer(array, ...values) { - const rest = new Set([...values].flat()); + const rest = new Set(values.flat()); return array.filter(element => !rest.has(element)); }