| Subcribe via RSS

javascript: typeof

March 8th, 2008 | No Comments | Posted in javascript by dreamluverz


typeof returns one of the following strings:

  • number
  • string
  • boolean
  • object
  • function
  • undefined

typeof(typeof(x)) is always string, no matter what x actually is.

IE seems to think that some functions are objects rather than functions: typeof(document.getElementById) returns object.

 

source: http://www.adp-gmbh.ch/web/js/operators/typeof.html

Tags: ,