Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are JavaScript Data Types?

Tags:

javascript

What are JavaScript Data Types?

like image 947
Yves Avatar asked Aug 17 '09 15:08

Yves


People also ask

What are the 7 data types in JavaScript?

There are seven primitive data types, Number, String, Boolean, NULL, Undefined and Symbol and one non-primitive data type 'object'. There are differences between NULL and undefined data types though both contain the same value.

What are 3 types of data in JavaScript?

JavaScript allows you to work with three primitive data types: numbers, strings of text (known as “strings”), and boolean truth values (known as “booleans”). JavaScript also defines two trivial data types, null and undefined, each of which defines only a single value.


1 Answers

There's

  • Numbers
  • Strings
  • Booleans
  • Objects
  • null
  • undefined

Note that there isn't a separate Integer, just number - which is represented as a double precision floating point number.

There's also

  • Functions
  • Arrays
  • RegExps

all of which are Objects deep down, but with enough special wiring to be mentioned on their own.

like image 153
Magnar Avatar answered Sep 22 '22 09:09

Magnar