Set length property
Mark S. Miller
erights at google.com
Tue Feb 14 18:34:39 PST 2012
On Tue, Feb 14, 2012 at 1:20 PM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:
>
> I don't want to go looking anything up right now, but I have lots of
> memories of things looking for the presence of "length" to denote an
> array-like.
If someone does look for examples, this would be helpful. The issue is
"array-like in what ways"? Other than being iteratable, Sets and Maps
aren't array-like in any other way I can think of. And "iteratable" is new
with ES6 so that can't be the commonality. OTOH, functions have a "length"
and they aren't array like in any way I can fathom. The possible confusion
with functions may have already deterred people from duck typing on
"length".
OTOH, some bozo (me) once proposed <
http://wiki.ecmascript.org/doku.php?id=conventions:isarraylike>. Hopefully
no one followed my advice ;).
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120214/dd3ce2b6/attachment.html>
More information about the es-discuss
mailing list