4 ms·
To be honest, using them to define iterators seems a bit strange, but I guess that's the choice that's been made.
by bpicolo 11y ago
To be honest, using them to define iterators seems a bit strange, but I guess that's the choice that's been made.
- thomasfoster96 11y agoWell, it's a good compromise to avoid having a 'iterate' method on the object prototype, which would risk name collisions, etc.
- bpicolo 11y agoThey could do it a'la python __iter__ or something of that nature. I think the python strategy is a bit cleaner. (Even then __iter__ could be a keyword meaning Symbol.iterator if that's the way to do it). Mixing symbols in for something that seems asymptotic is the strange part.