I recently came across an interesting page called ‘Types’ in the documentation of my favorite Javascript library, jQuery. It is a brief summary of Javascript language properties, and a very good read that reveals many little known quirks that this untraditional language offers.
One thing in particular caught my attention - the type of the NaN (Not A Number) language value, is surprisingly enough, a number. Try it, write a simple script alerting the typeof of NaN:
var isNumber = NaN; alert(typeof(isNumber)); // Alerts 'number'
Just another thing to keep you on your toes when working with Javascript ![]()
Posted under Javascript, Web development




2008 - The Future
Thanks for the ‘Types’ page link
Comment by Ori Peleg — 27 May @ 2:18 am