DEV Community

Cover image for Data Types In Javascript
aidoskashenov
aidoskashenov

Posted on

Data Types In Javascript

There are 3 types of data types in Javascript: primitive and composite and data types.
Primitive data types are simple types like "Strings", Number, Boolean, undefined and null. Composite data are Arrays, Objects and Functions.
Primitive data types are those that can hold only one type of value and cannot be subject to use of a methods, whereas objects and arrays can hold multiple data units and all the methods and functions are using objects as their arguments. Everything is an Object in Javascript and that's why Javascript is called an Object Oriented Language
However, some of the sources distinguish 3 types of data separating undefined and null as a "special" data type. These two types can be confusing, but to put it simply, undefined means that a variable was never defined in the code, and null means that there is no value.

Top comments (1)

Collapse
 
yornsokha profile image
YornSokha

As the paragraph has only mentioned about primitive and composite, how about data types?