coffeescript
coffeescript copied to clipboard
Will Coffee-script add yield statement?
something like this
counter = (start = 0, step = 1) ->
idx = start
while true
yield idx
idx += step
countFrom10 = counter 10
countFrom10() # returns 10
countFrom10() # returns 11
countFrom10() # returns 12
# and so on and so forth . . .
Very unlikely, at least for now. jashkenas wants to keep support in for IE6. One day, he'll give it up. With microsoft now counting down until its doom, it seems like that day is actually on the horizon.
No -- yield is not a standard part of JavaScript, and doesn't work in any browser apart from Firefox.