This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function fibo1(n) { | |
if (n === 0 || n === 1) return n; | |
const f1 = await fibo1(n - 1); | |
const f2 = await fibo1(n - 2); | |
return f1 + f2; | |
} | |
async function fibo2(n) { | |
if (n === 0 || n === 1) return n; | |
const [f1, f2] = await Promise.all([fibo2(n - 1), fibo2(n - 2)]); |