function fib(n) {
if (n < 1) return 0
if (n < 3) return 1
const memo = new Map()
if (!memo.has(n)) {
memo.set(n, fib(n-1) + fib(n-2))
}
return memo.get(n)
}
for (let i = 0; i < 70; i++) {
console.log(fib(i))
}
To embed this project on your website, copy the following code and paste it into your website's HTML: