Skip to main content

Bug Tracker

Side navigation

#11573 closed bug (duplicate)

Opened April 10, 2012 08:43AM UTC

Closed April 10, 2012 10:22AM UTC

Last modified April 10, 2012 10:22AM UTC

[jQuery.each] gives wrong result when a object adds a property [length].

Reported by: moonsunfall@yahoo.cn Owned by:
Priority: low Milestone: None
Component: misc Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

var testEachObj = {length : 2};

$.each(testEachObj, function(key, value){

console.log('key = ' + key);

console.log('value = ' + value);

});

the firebug logs:

key = 0

value = undefined

key = 1

value = undefined

expect log should be:

key = length

value = 2

Attachments (0)
Change History (2)

Changed April 10, 2012 10:22AM UTC by sindresorhus comment:1

component: unfiledmisc
priority: undecidedlow
resolution: → duplicate
status: newclosed

Changed April 10, 2012 10:22AM UTC by sindresorhus comment:2

Duplicate of #7260.