Added linting, processed current snippets

This commit is contained in:
Angelos Chalaris
2017-12-14 00:05:44 +02:00
parent f6426792d3
commit 143c024968
35 changed files with 2079 additions and 76 deletions

View File

@ -4,7 +4,7 @@ Create an empty array of the specific length, initializing the first two values
Use `Array.reduce()` to add values into the array, using the sum of the last two values, except for the first two.
```js
const fibonacci = n =>
Array(n).fill(0).reduce((acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),[]);
const fibonacci = n =>
Array(n).fill(0).reduce((acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i), []);
// fibonacci(5) -> [0,1,1,2,3]
```