Hi,

While looking at some data grid code I noticed this:

            try
            {
                data = data[dataField];
            }
            catch(e:Error)
            {
                data = null;
            }

And I was curious to why try catch is used rather than this:

            if (dataField in data)
            {
                data = data[dataField];
            }
            else
            {
                data = null;
            }

I know "in" can be expensive but so is try catch. I've run each though scout 
and it looks like the in operator is orders of magnitude faster and caused no 
garbage collection both when the field exists and when it doesn't. Anyone have 
any insight/something to add?

Thanks,
Justin

Reply via email to