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)); } 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) + ---