$().each vs $.each vs for loop in jQuery?
I Can't understand why it is happening. I read here that : The first $.each constitutes a single function call to start the iterator. The second $(foo.vals).each makes three function calls to start the iterator. The first is to the $() which produces a new jQuery wrapper set (Not sure how many other function calls are made during this process). Then the call to $().each. And finally it makes the internal call to jQuery.each to start the iterator. In your example, the difference would be negligible to say the least. However, in a nested use scenario, you might find performance becoming an issue