https://gist.github.com/986590

Fibonacci in 53 bytes
function(n){for(var a=0,b=1;n--;)b=a+(a=b);return a;}

so...

var f = [0, 1, 1, 2, 3, 5, 8, 13];
function nextF(n){for(var a=0,b=1;n--;)b=a+(a=b);return a;}

console.log(nextF(f.length)); // 21
-- 
Dimitar Christoff <[email protected]> 

blog: http://fragged.org/  twitter: @D_mitar 

Reply via email to