doipjs/node_modules/reusify/benchmarks/fib.js
Yarmo Mackenbach e996bc8023 Initial commit
2020-10-23 22:35:53 +02:00

13 lines
177 B
JavaScript

'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