Archive, multitagging, cleanup

Cleaned up the current snippets for consistency and minor problems, added multiple tags to most of them, archived a few.
This commit is contained in:
Angelos Chalaris
2018-01-05 16:33:54 +02:00
parent f91b28d3fc
commit 0425ebefe7
55 changed files with 2650 additions and 2682 deletions

View File

@ -9,10 +9,11 @@ Otherwise, return the GCD of `y` and the remainder of the division `x/y`.
```js
const gcd = (...arr) => {
const _gcd = (x, y) => (!y ? x : gcd(y, x % y));
return [].concat(...arr).reduce((a, b) => _gcd(a, b));
return [...arr].reduce((a, b) => _gcd(a, b));
};
```
```js
gcd(8, 36); // 4
gcd(...[12,8,32]); // 4
```