Whelp, there I go putting foot in mouth with untested code. Just ran the tests.

Yep

foo === undefined; yields true

Well then. Cheery-o, I'm out of this debate, KOed by Martin.

Still, don't think it much matters in the end. Maybe undefined is more correct, in light of what I just learned, but I'm more used to null for these cases (obviously as I didn't even know undefined was a real object.).

On 9/22/06, Martin Bialasinski <[EMAIL PROTECTED]> wrote:

On 9/22/06, Ryan Gahl <[EMAIL PROTECTED]> wrote:

> null is a value directly assignable to a variable. "undefined" is a string
> represntation of a _javascript_ type.

There  is window.undefined which is of the ECMAScript built-in type "Undefined".
ECMAScript 4.2

>
> var foo;
>
> alert(foo == null); // true

Because both built-in types, Null and Undefined, evaluate to false in
boolean context. ECMAScript 9.2

foo === null // false

> Otherwise you are creating new objects in memory (strings of
> "undefined"),

Not true.

Athena Group, Inc.
Inquire: 1-920-954-9798 x2903
Blog: http://www.someElement.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to