what is iterator and generator in javascript?
JavaScript provides a number of ways of iterating over a collection, from simple for loops to map() and filter() . Iterators and Generators bring the concept of iteration directly into the core language and provide a mechanism for customizing the behavior of for...of loops. ... function* and Generator. yield and yield*