incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Arno" <>
Subject RE: [CODE] Short cleanup
Date Fri, 24 Feb 2012 12:26:34 GMT
> From: Left Right [] 
> 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) ...


	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.


View raw message