Rss subscribe!
It's free.

about

A blog about web development and starting up online.


who

Eran Galperin is the techfounder, an Internet entrepreneur and web technologies expert.

26 May

Not a numberI 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 ;-)

Share this article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • DZone
  • del.icio.us
  • Technorati

Posted under Javascript, Web development

1 Comment »

  1. Thanks for the ‘Types’ page link :)

    Comment by Ori Peleg — 27 May @ 2:18 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Some rights reserved, Eran Galperin
CC 2008 - The Future