JavaScript Professional — Hard
Key points
- The generator function yields Fibonacci numbers indefinitely
- The spread operator `[...Array(5)]` creates an array of length 5
- The `map` function calls `fib.next().value` 5 times
- The correct answer matches the first 5 Fibonacci numbers
Ready to go further?
Related questions
