JSFiddle - React, Tailwind, and code Playground

JavaScript

//This one caches the previous results so we're not constantly re-calculating things we already know
//JS adaption of: http://www.cs.northwestern.edu/academics/courses/110/html/fib_rec.html
function fibDriver(n) {
  return n === 0 ? 0 : fib(n, 0, 1);
}

function fib(n, a, b) {
  return n === 1 ? b : fib(n-1, b, a + b);
}
console.log(fibDriver(6));