> From: Left Right [mailto:olegsivo...@gmail.com] 
> Sent: 24 February 2012 11:10

> OMG!!! Seriously, you are writing SDK code and you don't know what's the 
> difference between using `in' operator and calling a method defined on 
> Object.prototype is?
Interesting. Seeing someone else by rude brings home to me why people didn't
like me doing it.


Left Right,

What are the benefits / disadvantages of 

        if (collection[item] !== undefined) ...

versus

        if (item in collection) ...

The latter is easier on the eye, but does it have objective benefits (speed,
reliability etc)? I haven't tried it, but I suspect the former only works
properly if item is a string.

David.

Reply via email to