Random JavaScript weirdness

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!