JSFiddle - React, Tailwind, and code Playground

by krustnic

JavaScript

function fibonacci(num){
  var a = 1, b = 0, temp;

  while (num >= 0){
    temp = a;
    a = a + b;
    b = temp;
    num--;
  }

  return b;
}

function productFib(prod){
  const f = fibonacci(prod)
  
  return f
}

console.log(123)
// console.log(productFib(10))