Javascript is Wacky

I was looking through Smashing Magazine and found an amazing article about some of JavaScript’s wacky behaviors find the link here

Here are a couple that I found really interesting

  1. NaN (Not a Number) is actually a number that equals nothing, not even it’s self;
    alert(typeof NaN); //alerts 'Number'
    alert(NaN === NaN); //evaluates false
  2. Undefined can be Defined
    var someVar;
    alert(someVar == undefined); //evaluates true
    undefined = "I'm not undefined!";
    var someVar;
    alert(someVar == undefined); //evaluates false!

Very Interesting stuff, if you want more examples visit Smashing Magazine




  1. Leave a comment

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: