Posts Tagged javascript

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

Thanks

 

Leave a comment