Changes between Initial Version and Version 1 of Ticket #7260, comment 1
- Timestamp:
- Oct 20, 2010, 5:25:30 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #7260, comment 1
initial v1 1 I think you misread the documentation. `$.each` behaves exactly as expected and as documented.1 This exact behavior is well documented thus `$.each` behaves exactly as expected. 2 2 3 3 From http://api.jquery.com/jQuery.each/ 4 4 >Arrays and **array-like objects with a length property** (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. 5 5 6 This sentence covers your case, stating that objects with a length property (as in your example) are iterated by numeric index.7 8 So if you remove/name the length property in your sample object `$.each` while behave as expected.9 10 6 Here a [http://www.jsfiddle.net/jitter/qvWAQ/ live test case] to show what is happening.