Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function static getNumberOfFibbonaciAtPosition(position) {
- if ( position === 0 || position === 1 ) {
- return 1;
- }
- return getNumberOfFibbonaciAtPosition(position - 2) + getNumberOfFibbonaciAtPosition(position - 1);
- }
- var eightNumber = getNumberOfFibbonaciAtPosition(8);
- console.log(eightNumber);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement