On 10/28/10, Allen Wirfs-Brock <[email protected]> wrote: > If we assume “Array like object” is an object that can serve as the this > value of the Array.prototype methods then pretty much any object is “Array > like”. The Array.prototype methods generally iterate based upon the value > of the this object’s length property. They use ToUint32 to interpret length > as a positive value in the 0..2^32-1 range. If the this object does not > have a length property, [[Get]] will return undefined which ToUint32 > converts to 0. All other non-numeric values also convert to values in the > 0..2^32-1 range. ...xxx
0..2^32-2. Remember, length is at most 2^32-1. The largest array index must necessarily be 1 less than that. http://ecma262-5.com/ELS5_HTML.htm#Section_15.4 Things like non-numeric string values first convert to NaN > and then to 0. > > So objects without a length or with a length value for which ToNumber > produces NaN are treated as 0 length “arrays”. > This seems to be a different argument: That any object can be used in an array method. Array-like has come up before here, once proposed by me, later, by Mike Samuel. Garrett _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

