Modify ↓
Ticket #9023 (closed bug: invalid)
jQuery.map( { length: 0 } )
| Reported by: | rkatic | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | core | Version: | 1.5.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
IF
{ length: 3, 0: "a", 1: "b", 2: "c" }
is array-like, then there is NO reason why
{ length: 0 }
should not.
Change History
comment:1 Changed 2 years ago by rwaldron
- Priority changed from undecided to low
- Resolution set to invalid
- Status changed from new to closed
- Component changed from unfiled to core
comment:2 Changed 2 years ago by rkatic
Disagree.
"Array-like objects, such as jQuery collections, are treated as arrays. In other words, if an object has a .length property and a value on the .length - 1 index, it is traversed as an array."
So { length: 0, "-1": "a" } is a an array, but { length: 0 } is not?
comment:6 Changed 2 years ago by rkatic
A real-world example: http://bugs.jquery.com/ticket/9023
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Consider the following:
Array-like objects, such as jQuery collections, are treated as arrays. In other words, if an object has a .length property and a value on the .length - 1 index, it is traversed as an array.
From http://api.jquery.com/jquery.map/
Your example does not meet the criteria and therefore is invalid.