fib

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
fib1
const number = parseInt(5);
let n1 = 0, n2 = 1, nextTerm;

console.log('Fibonacci Series:');

for (let i = 1; i <= number; i++) {
    console.log(n1);
    nextTerm = n1 + n2;
    n1 = n2;
    n2 = nextTerm;
}
ready
fib2
const number = parseInt(5);
let n1 = 0, n2 = 1, nextTerm;

console.log('Fibonacci Series:');

for (let i = 1; i <= number; i++) {
    console.log(n1);
    nextTerm = n1 + n2;
    n1 = n2;
    n2 = nextTerm;
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.