You-dont-know-js: You Don't Know JS: Up & Going, Chapter 2: Into JavaScript,

Created on 15 Feb 2017  路  2Comments  路  Source: getify/You-Dont-Know-JS

The return value from the typeof operator is always one of six (seven as of ES6! - the "symbol" type) string values.

, What about the typeof(user defined function)? It does return as function. So it should be seven(or eight including symbol)!. I'm new to JavaScript, Correct me If I'm wrong. But when tried in Chrome console typeof for user defined function returned as function.
capture

Most helpful comment

"function" is not updated in the page!!

All 2 comments

The following are the only return values for typeof:

  • "undefined"
  • "number"
  • "string"
  • "boolean"
  • "object"
  • "function"
  • "symbol"

There's 7 of them. Technically, "null" should be the 8th one, but it's a long-known bug that typeof null is actually "object".

"function" is not updated in the page!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laoshaw picture laoshaw  路  3Comments

madmadi picture madmadi  路  5Comments

jorendorff picture jorendorff  路  5Comments

ahmedvip2008 picture ahmedvip2008  路  3Comments

garrettwgg picture garrettwgg  路  5Comments