This post was published on Tuesday 9th of May 2006.
I've always known JavaScript had some weird, weird features but I thought this was pretty funny:
alert(typeof NaN); // number
This is pretty baffling though:
var a = '3' + 1; alert(a); // 31 alert(typeof a); // string var b = '3' - 1; alert(b); // 2 alert(typeof b); // number var c = '3' - '2'; alert(c); // 1 alert(typeof c); // number var d = '4' / '2'; alert(d); // 2 alert(typeof d); // number
Have something to say about this post? Share your thoughts!
This post was published on Tuesday 9th of May 2006.
The previous entry was "Backbase browser support".
The next entry is "The JavaScript Array.splice() method".