[dojo-contributors] Re: dojo.lang.isUndefined()

Jon Sykes jon.sykes at media-hive.com
Thu Jun 29 14:38:50 EDT 2006

Yup, I pasted what the function does now.  Rather than what the  
function should do:

if((typeof wh == "undefined")||(wh == undefined))alert("wh is  

Is what you are saying that if I did:




alert("OMG you tried to do something with foo and it doesn't exist);


would cause a JS error anyway?

or would the above work if isUnDefined actually did test for  
undefined global objects with needing them to be tested as a property  
of an existing object?

On Jun 29, 2006, at 2:30 PM, Scott J. Miles wrote:

>> if((wh == undefined)&&(typeof wh == "undefined"))alert("foo is  
>> undefined");
>> in to the firebug console and hit enter, if you don't have foo  
>> set, it will
>> fire the alert.  Isn't that what isUndefined should do? <<
> It looks like you didn't paste what you meant to paste: your  
> example doesn't
> reference 'foo' at all. Putting what you did paste into the  
> console, an
> exception is thrown because 'wh' cannot be evaluated as an operand  
> to '==',
> which is exactly my point.

More information about the dojo-contributors mailing list