paperlined.org
rosetta_stone > languages
document updated 13 years ago, on Nov 14, 2011
How do you 1) assign and 2) check for the value of "undefined" or "null" or "NaN" in various languages?

Perl
my $a = undef;

if (defined($a)) {
   ...
}
Javascript
var a;
    
if (typeof(a) == "undefined") {
    ...
}

undefined = "Variable shouldn't be assignable, but before ECMA5, it was";
var a = null;

if (a === null && a !== null) {
    ...
}
SQL
SELECT * FROM TableName WHERE colname IS NOT NULL;