Data Types in JavaScript
Definition of datatype:
A data type is a classification that dictates what a variable or object can hold in computer programming. the datatype is used the store which type of data will store on variable.
Primitive Data Types
- Primitive data types are the simplest building blocks of a program.
- They are types that can be assigned a single literal value such as the number, or a string of characters.
- JavaScript supports three core or basic data types:
• numeric
• string
• Boolean
In addition to the three core data types, there are two other special types that consist of a
single value:
• null
• undefined
Example of datatype :
string str = "hello"
var a = 45