Implement a custom iterator in JavaScript that iterates over Fibonacci numbers.

Instruction: Write a custom iterator that generates an infinite sequence of Fibonacci numbers.

Context: This question tests the candidate's understanding of the iterator protocol and their ability to implement custom iterable objects.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

Define the sequence as 0, 1, 1, 2, 3, 5, ... ...

Related Questions