On 2/19/07, Tobie Langel <[EMAIL PROTECTED]> wrote:
> However, when I see the plethora of ways we currently test to see if a
> variable is undefined:
>     typeof example == 'undefined'
>     example === undefined

I think the middle one is the cheapest (both first are correct).

    example == undefined (is that correct btw?)

Depending on what you need to check. Sometimes you want to treat null and
undefined the same, sometimes you don't. Let's not have these discussions, I
had too much back in the PHP world. It always depends on what you're doing
in the code.

I'm sure there's something we could do about this.
> So there's another proposition I just though of, introducing the "is"
> namespace:

Actually, I like your "is" namespace a lot! But - would the name be
obtrusive? What if someone defines "is" variable in the global namespace (on
the window object), will closures save subsequent calls to real "is" in the

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to