fib.js 177 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 'use strict' function fib (num) { var fib = [] fib[0] = 0 fib[1] = 1 for (var i = 2; i <= num; i++) { fib[i] = fib[i - 2] + fib[i - 1] } } module.exports = fib