Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Leonardo-numbers/JavaScript/leonardo-numbers-1.js
Normal file
9
Task/Leonardo-numbers/JavaScript/leonardo-numbers-1.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const leoNum = (c, l0 = 1, l1 = 1, add = 1) =>
|
||||
new Array(c).fill(add).reduce(
|
||||
(p, c, i) => i > 1 ? (
|
||||
p.push(p[i - 1] + p[i - 2] + c) && p
|
||||
) : p, [l0, l1]
|
||||
);
|
||||
|
||||
console.log(leoNum(25));
|
||||
console.log(leoNum(25, 0, 1, 0));
|
||||
Loading…
Add table
Add a link
Reference in a new issue