(limit)
| 13 | return sum; |
| 14 | }, |
| 15 | async fibonacci(limit) { |
| 16 | await sleep(Math.random() * 100); |
| 17 | let prev = 1n, next = 0n, swap; |
| 18 | while (limit) { swap = prev; prev = prev + next; next = swap; limit--; } |
| 19 | return String(next); // <4> |
| 20 | }, |
| 21 | async bad() { |
| 22 | await sleep(Math.random() * 10); |
| 23 | throw new Error('oh no'); |