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

Bob Ippolito bob at redivi.com
Thu Jun 29 19:29:32 EDT 2006


On Jun 29, 2006, at 4:22 PM, Scott J. Miles wrote:

>>> Well, it's not possible to write a function that tests whether a  
>>> global
> is defined or not (unless you check [the name as string] as a  
> property of
> global object). That's what dj_undef does isn't it? <<
>
> Yes, that's much clearer, I wish I'd just said that in the first  
> place.
> That's exactly what dj_undef does.
>
> dj_undef("foo"); // tests window["foo"]
> dj_undef("foo", obj); // tests obj["foo"]
>
> Also, I thought I'd mention that dj_undef doesn't come up much if  
> one is in
> the habit of namespacing application code.

If you wanted to be pedantic...

dojo.global().dj_undef("foo");

:)

-bob




More information about the dojo-contributors mailing list