Home > Article > Web Front-end > What are the two categories of JavaScript data types?
Javascript data types are divided into:
Value types (basic types): String, Number, Boolean ( Boolean), Null, Undefined, Symbol.
Reference data types: Object, Array, Function.
Dynamic typing:
JavaScript has dynamic typing. This means that the same variable can be used as different types.
Example:
The result shows:
Three ways to declare arrays :
Two addressing modes for object properties:
Example:
Output:
Recommended tutorial: js introductory tutorial
The above is the detailed content of What are the two categories of JavaScript data types?. For more information, please follow other related articles on the PHP Chinese website!