JS Data types
JavaScript provides different data types to hold different types of values. There are two types of data types in JavaScript.
1. Primitive data type
2. Non-primitive (reference) data type
JavaScript is a dynamic type language, means you don't need to specify type of the variable because it is dynamically used by JavaScript engine. You need to use var, let or const here to specify the data type. It can hold any type of values such as numbers, strings etc. For example:
Primitive data type
Data type | Description |
---|---|
String | represents sequence of characters e.g. "hello" |
Number | represents numeric values e.g. 100 |
Boolean | represents boolean value either false or true |
Undefined | represents undefined value |
Null | represents null i.e. no value at all |
Non Primitive data type
Data type | Description |
---|---|
Object | represents instance through which we can access members |
Array | represents group of data having similar data types |
Regex | regular expression |
Now that you know data types in javascript, let's learn operators, types of operators
Share this page on :
© 2022 AnalyzeCode.com All rights reserved.