Axel Rauschmayer wrote:
let iterable = { *[iterator]() { yield 5; } };
Presented without comment...
I'm sorry, but I reject this kind of argument. That code is simply
more concise than:
let iterable = { [iterator]: function*() { yield 5 } };
Given that the concise notation means that ': function' is omitted,
wouldn’t it be better to write:
let iterable = { [iterator]*() { yield 5; } };
Maybe, but I think the star should come first. The problem is that
function* iterator() { yield 5; } is the named generator function form.
* after function and before name. * before name preserved in the
property definition case means *[iterator]() { yield 5; }.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss