Generators have a * because it is sometimes desirable to be able to create 
a generator that does not yield. Consider the following:

function* genIntegers() { var i = 0; while (true) yield i++; }
function* genNothing() { }

function doSomethingWithGenerator(g) { ... }
function foobar(really) { doSomethingWithGenerator(really ? genIntegers() : 
genNothing()); }

Bruno

On Saturday, September 13, 2014 4:08:42 AM UTC+2, Ep Ga wrote:
>
> I just... I just find it more easier to understand ES5 than Es6... A few 
> of there new addition I can see of use, but for most I'm cloudy on... I 
> just want to be able to always use ES5 with addition to it as ES+... I like 
> the callback hell, and node have module that can be use to break it down 
> into an saner view.
>
> I'm ES5+.... Just won't some comfort knowing that i can use it's style 
> instead of this new syntax style....
>
> Generators, why do they have *? Couldn't the yield sign defined a behavior 
> of the function to a generator behavior? And even understand or better yet 
> compwthending the act of generator is not clear to me....
>
> And why couldn't they be a key word instead of adding a funny syntax to 
> it? Like Geneator(); and generator(); for both constructor and statment?
>
> And promise???
>
> I just.... Anyone care to give a feedback?
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/e1ca9baa-b50d-43eb-b73a-4e49cecb145d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to