yield; vs yield undefined
# Brendan Eich (13 years ago)
Wiki error. Sorry I did not catch it.
Wiki error. Sorry I did not catch it. /be On Feb 23, 2013, at 5:22 PM, Erik Arvidsson <erik.arvidsson at gmail.com> wrote: > Corrently, the wiki page says that "yield" should throw StopIteration > but "yield undefined" yields the value undefined. Is this by design? I > find it a bit strange that it does not follow the "return" analogy > where "return" is short for "return undefined" > > -- > erik > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss
Corrently, the wiki page says that "yield" should throw StopIteration but "yield undefined" yields the value undefined. Is this by design? I find it a bit strange that it does not follow the "return" analogy where "return" is short for "return undefined"