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 (0)