Skip to content

Commit 3f7be55

Browse files
authored
Merge pull request vJechsmayr#127 from kameldadda/fibonacci
Fibonacci
2 parents 15579d0 + c583d1d commit 3f7be55

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎NumberConvertions/Fibonacci.js‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
fibo = function (x) {
2+
if (x === 0) {
3+
return 0;
4+
}
5+
if (x <= 2) {
6+
return 1;
7+
}
8+
return this.fibo(x - 1) + this.fibo(x - 2);
9+
};
10+
fibonacci = function (x) {
11+
for (var i = 0; i < x; i++) {
12+
{
13+
console.info(fibo(i + 1));
14+
}
15+
;
16+
}
17+
};
18+
19+

0 commit comments

Comments
 (0)