RE: Elements array and query/queryAll methods
Domenic Denicola <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <9c1acafa4a2042c3acfc3025540aef21@BN1PR05MB325.namprd05.prod.outlook.com> |
From: Rick Waldron <[email protected]> > This is nothing more than a whim, but would a Set subclass be more appropriate? Possibly (although I don't think it would solve the "typed" problem at all; you'd just do `Set.prototype.add.call(elementsInstance, notAnElement)`). It conceptually seems better. However the ergonomics are pretty bad, and it's not what developers have been asking for (something jQuery-like). If sets had a *lot* more methods, it'd be more of a possibility. Also maybe if we were sure developers had embraced them. (Side tangent: I am hopeful the ES7-proposed bind operator + libraries of `this`-using "itertools" functionality can prevent us from having to add tons of methods to every collection class, and thus make `Set` and so on more useful without having to wait for standards-body work. Just an idle dream though...)