Datatypes in Javascript – setting the record straight

[tweetmeme]
It’s a question that often comes up and there are many places on the internet that give an inaccurate answer, so here’s the real-deal.

Javascript has three primitive datatypes:

  • number
  • string
  • boolean

There are another two special datatypes:

  • null
  • undefined

The others are variations of object:

  • object
  • function
  • array

See here for further reading.

Advertisements

2 Responses to “Datatypes in Javascript – setting the record straight”

  1. Luke Smith Says:

    RegExp, Date, Error

  2. Datatypes in Javascript – setting the record straight « Fringley's Blog Says:

    […] reading Datatypes in Javascript – setting the record straight on my old blog… Categories […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: