Thanks! Now I'm convinced. I never thought it's going to be that complicated. Maybe I just should stick with "for( key in object )".
On Oct 30, 10:42 pm, Robert Katić <robert.ka...@gmail.com> wrote: > > I think it should make the following expression evaluate to true: > > > object && object.constructor === Object > > ( I'm not sure if it's strict enough, but what I mean is that the > > object should be constructed by Object ) > > This is technically a more complex problem then you think. > There was an John initiative to evolve an > isObjectLiteral(obj)http://gist.github.com/153271 > I made an solution for it athttp://gist.github.com/158651that passes > all tests, but that shows how it complex it is too. > I think it would be an overhead. We have to avoid to make this > stuffs.. > > > I think Array.prototype should never be extended, if it does, $.extend > > () is the first one to be broken (at least for jQuery 1.3.2). > > No. It array-like objects and other ones in different ways. > > > As for array-like objects, you can see how $.each() is implemented (I > > think it's like a convention that if an object conforms the condition > > I mentioned before, and has a "length" property, it should be treated > > like an array) > > I know exactly the $.each() implementation, and how I said, the only > way to detect array-like objects is to check the length property. It > is weak, but in case of $.each you normally know exactly witch > proprieties has an object. -- You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-...@googlegroups.com. To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.