DEV Community

Cover image for Data Types in Javascript
aidoskashenov
aidoskashenov

Posted on

2

Data Types in Javascript

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)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay