On 07/30/2010 06:43 AM, Oliver Hunt wrote:
all array functions defined in ES5 are "generic" in that they work over any array-like object.
They're guaranteed to work over any array-like native JavaScript object. They're *not* guaranteed to work on host objects like the various node lists.
FWIW in practice `Array.prototype.*.call(htmlcollection)` does work on the modern desktop browsers except for IE.
It would be possible to specify that the native-JS object guarantee should also extend to node lists. This would allow fast browser implementations of the array-like methods to be used without having to copy to a new Array. However this would still leave the method of calling them a little ugly.
-- And Clover mailto:a...@doxdesk.com http://www.doxdesk.com/