Data Types in JavaScript

Other languages like C, C++, JAVA, C# and Python JavaScript also provides different data types. There are two types of data types in JavaScript.
1-- Primitive data type
2-- Non-primitive (reference) data type

JavaScript Types are Dynamic

In JavaScript there is no need to specify the data types of variables of JavaScript is totally dynamic and it's variables are also dynamic used by JavaScript engine. There is you have to use var to specify a variable to specify the data type. It can hold any type of values such as numbers, strings etc. For example:

<script type = "text/javascript">
var name = "Ali";
var money;
money = 2000.50;

JavaScript primitive data types

There are five types of primitive data types in JavaScript. They are as follows:

Data Type Description
String It represents sequence of characters e.g. "hello"
Number It represents numeric values e.g. 100
Boolean It represents boolean value either false or true
Undefined It represents undefined value
Null It represents null i.e. no value at all

JavaScript non-primitive data types

The non-primitive data types are as follows:

Data Type Description
Object It represents instance through which we can access members
Array It represents group of similar values
RegExp It represents regular expression

The Best

Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.