update snippets 16-31

This commit is contained in:
Stefan Feješ
2017-12-25 14:05:36 +01:00
parent 9b57350525
commit 823aa0c305
15 changed files with 66 additions and 27 deletions

View File

@ -6,5 +6,8 @@ Create a `Set` from `b`, then use `Array.filter()` on `a` to only keep values no
```js
const difference = (a, b) => { const s = new Set(b); return a.filter(x => !s.has(x)); };
// difference([1,2,3], [1,2,4]) -> [3]
```
```js
difference([1,2,3], [1,2,4]) -> [3]
```