Amazingly in depth post!
I'm sad when programming languages have to reach for new keywords and syntax to add features.
`function*` is difficult to google for, and doesn't have any human readable hints for somebody to understand.
I'm sad when programming languages have to reach for new keywords and syntax to add features.
`function*` is difficult to google for, and doesn't have any human readable hints for somebody to understand.
I don't agree the keyword "generator" would have been ideal. It wouldn't work when using 'enhanced object literals' [1], where you can declare a method without even using the keyword "function". In this case, if you want the method to be a generator, you can just put an asterisk in front of its name, so it's consistent with the "function*" syntax.
[1] https://babeljs.io/docs/learn-es6/#enhanced-object-literals
It seems like a word must be reserved for at least one ES version prior to it being used.
generator (a, b, c) {
···
}