mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-25 03:02:21 +00:00
Merge pull request #232 from shiasn/gh-pages
fix: function Fibonacci2 bug
This commit is contained in:
commit
dff4d65aba
@ -1230,7 +1230,7 @@ Fibonacci(10); // 89
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
function Fibonacci2 (n , ac1 = 1 , ac2 = 1) {
|
function Fibonacci2 (n , ac1 = 1 , ac2 = 1) {
|
||||||
if( n <= 1 ) {return ac1};
|
if( n <= 1 ) {return ac2};
|
||||||
|
|
||||||
return Fibonacci2 (n-1 , ac2 , ac1 + ac2);
|
return Fibonacci2 (n-1 , ac2 , ac1 + ac2);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user