Le 12/11/2013 18:30, Axel Rauschmayer a écrit :
This is relevant, too: http://esdiscuss.org/topic/function-declarations-with-lexical-this

I'd still argue that generator arrow functions make more sense than generator function declarations.
I don't have a strong opinion in this debate, but I've seen something relevant in Angus Croll's slides [1] recently:

  let idGenerator = (id=0) => () => id++;

  let nextFrom1000 = idGenerator(1000);
  nextFrom1000(); // 1000
  nextFrom1000(); // 1001

David

[1] https://speakerdeck.com/anguscroll/es6-uncensored?slide=42
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to