Rick Waldron
I'm speaking of this:
function foo(x){
While(x){
yield x.pop();
}
}
var bar = Foo(["foo","bar","baz"]);
for(;bar;) console.log(bar.next())://baz, bar, foo, undefined
I welcome this, the ES5+ spec welcome this!
But not this:
function* foo(x){
While(x){
yield x.pop();
}
}
var bar = Foo(["foo","bar","baz"]);
for(;bar;) console.log(bar.next())://{value: baz, done:false}{value: bar,
done:false}{value: foo, done:false}{value: undefined, done:false} the done
property will never be true consider that the while loop will not continue
after coming across a false condition. And or the yield sign consider the pop()
method being active on an undefined array.
Returning an object that will need to be parse.
--
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/c1504cef-77b6-4515-970b-707f0704e532%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.