I realized that given the following:
foo = {a:'aa', b:'bb'}
$.each(foo, function(k,v) { ...
$(foo).each(function(k,v) { ...
the values of k,v is different in both cases. Is it me that is weird or is jquery inconsistent?
EDIT
If you come here to explain the difference between $.each and $(foo).each, I want to clarify that I know the difference between the two.
Under the
"Working with plain objects"section of thejQuery()docs, there are a number of options, but enumerating with.each()isn’t one of them.You should use the generic
$.each()enumerator.