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,985
  • 4
  • 34
  • 62
vitaly-t
  • 24,279
  • 15
  • 116
  • 138
  • @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