|
|
|
|
|
by colin_jack
5003 days ago
|
|
This is from the a section on custom iterators in the related blog post (https://brendaneich.com/2012/10/harmony-of-dreams-come-true/): "We require opt-in to avoid future-hostility against custom iterators for collection objects. Such objects probably do not want any kind of general property iterator default, which if left on Object.prototype, might be object-detected and prevent installation of the correct custom iterator factory." I can see the sense in that but I find all the little caveats in JS are one of it's weaknesses which makes me dislike this idea. Am I wrong to think they should have just put in a default iterator but made it easy to spot it so that you could replace it with a custom iterator where appropriate? |
|