getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
Other
178.87k stars 33.44k forks source link

generator functions syntax correction #1600

Closed Mhmdrza closed 4 years ago

Mhmdrza commented 4 years ago

the "" should be stick to function keyword not the function name; I already searched for this issue, reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function

getify commented 4 years ago

The * can be placed either next to function or next to the function's name, with or without spaces on either side of it. It's a stylistic preference. I prefer to put it next to the function name.