Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get nth fibonacci javascript

function nthFib(n) {
	if(n <= 2) return n -1;
  return nthFib(n - 2) + nthFib(n - 1);
}
 
PREVIOUS NEXT
Tagged: #nth #fibonacci #javascript
ADD COMMENT
Topic
Name
7+3 =