source: trip-planner-front/node_modules/reusify/benchmarks/fib.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 177 bytes
Line 
1'use strict'
2
3function fib (num) {
4 var fib = []
5
6 fib[0] = 0
7 fib[1] = 1
8 for (var i = 2; i <= num; i++) {
9 fib[i] = fib[i - 2] + fib[i - 1]
10 }
11}
12
13module.exports = fib
Note: See TracBrowser for help on using the repository browser.