0

In ES6 we can replace in-line function:

function(param){        
}

with this:

param=>{    
}

Does this no longer work with ES6 generators? Why can't we do something like:

param*=>{   
}

to provide an in-line generator function? I thought it would be a given, but nothing like this seems to work.

Am I missing something about in-line use of generators, or is it really that ES6 generators are 2 steps forward and 1 step back?

CoderPi
  • 12,423
  • 4
  • 31
  • 59
vitaly-t
  • 22,286
  • 10
  • 106
  • 127
  • @CodeiSir: I've flagged this question for merging into the duplicate, you can do so as well if you want (please don't copy it). However, I don't think your answer doesn't contain an explanation for *why* arrows cannot be generators either - it only states *that* they cannot. – Bergi Dec 05 '15 at 18:35

0 Answers0