"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?
I would just think default iterators are a sensible default especially for maps and that getting them in would be worth the very slight pain it might cause people wanting to attach custom iterators.
"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?