R
RobG
The following works provided obj is a native object and sufficiently
array-like:
var obj = {'0':'0','1':'1','2':'2', length: 3};
var a = Array.prototype.slice.call(obj);
However, if obj is a host object that is array-like (e.g. a NodeList),
it works in some browsers and not in others - it fails in IE 6 with a
NodeList.
Can someone tell me if it works in some later version of IE, and if
there are other browsers in which it also fails?
array-like:
var obj = {'0':'0','1':'1','2':'2', length: 3};
var a = Array.prototype.slice.call(obj);
However, if obj is a host object that is array-like (e.g. a NodeList),
it works in some browsers and not in others - it fails in IE 6 with a
NodeList.
Can someone tell me if it works in some later version of IE, and if
there are other browsers in which it also fails?