aboutsummaryrefslogtreecommitdiff
path: root/node_modules/reusify/benchmarks/fib.js
blob: e22cc48dec9efa13644385c395272f16a9e45462 (plain)
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