odin-js-fundamentals-part-5/node_modules/reusify/benchmarks/fib.js

14 lines
177 B
JavaScript
Raw Permalink Normal View History

2024-01-11 08:52:05 +00:00
'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