-
@AndrewJacksonZA sort of. a generator is like a function that runs up to the first
yieldexpression and returns a value. if it has more work to do, it can be run again at a different time until its nextyieldexpression (which might be the same as the first one in the case of a loop) -
@AndrewJacksonZA the mozilla docs are pretty good developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*#Syntax and the equivalent mechanism is C# is described over here docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/yield