/** * Returns the nth Fibonacci number. * @method f * @param {number} n * @return {number} */ function f (n) { var a = 0; var b = 1; var c = 0; while (n >= 0) { c = a; a = a + b; b = c; n--; } return b; }; Array.apply(null, Array(10)).map(function (_, i) { return f(i); });
Source code...
minify output
ES5
AST
ESTree
play_arrow
content_copy