Difficulty: 6/10iterable protocol, generator functions, stateful iteratorA reusable iterable returns a fresh iterator each time [Symbol.iterator]() is called, resetting the state for each iteration.Reusable iterableCopyScenario Questions0-2 years experience1We need a utility that returns an object you can use in a for...of loop to iterate over the numbers 1 through 5, and you should be able to loop over it multiple times. How would you implement that?2Imagine a simple class `Range` that should let callers do `for (const n of new Range(1,3))` and then later reuse the same instance in another loop. What code would you write to make it reusable?3If you wrote a generator function `function* numbers(){...}` and called it once, why does the resulting object only work for a single loop? How would you change it so the same function call can be used in multiple loops?Follow-up QuestionsWhat would happen if you returned the same iterator instance each time?How would you modify your design to support infinite sequences without leaking memory?Can you explain the difference between an iterator and an iterable in this context?Suggest Improvement