Question d’entretien chez GlobalLogic

what is a generator in javascript?

Réponse à la question d'entretien

Utilisateur anonyme

28 oct. 2020

Regular functions return only one, single value (or nothing). Generators can return (“yield”) multiple values, one after another, on-demand. They work great with iterables, allowing to create data streams with ease.