Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13372 closed bug (notabug)

eq(null) returns eq(0)

Reported by: jqcomptime Owned by:
Priority: undecided Milestone: None
Component: traversing Version: git
Keywords: Cc:
Blocked by: Blocking:

Description

.eq(null) returns the same as .eq(0)

but .eq(undefined) returns the empty set as does .eq() with no paramters

I would think .eq(null) and .eq(undefined) would return the same thing.

Or is this the expected behavior?

http://jsfiddle.net/RwzWW/

Change History (1)

comment:1 Changed 7 years ago by gibson042

Component: unfiledtraversing
Resolution: notabug
Status: newclosed

http://api.jquery.com/eq/

null is invalid input for .eq, and thus has undefined behavior.

Note: See TracTickets for help on using tickets.