Home  >  Article  >  Web Front-end  >  What are the two categories of JavaScript data types?

What are the two categories of JavaScript data types?

王林
王林Original
2020-05-26 17:57:124508browse

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:

What are the two categories of JavaScript data types?

The result shows:

What are the two categories of JavaScript data types?

Three ways to declare arrays :

What are the two categories of JavaScript data types?

Two addressing modes for object properties:

Example:

What are the two categories of JavaScript data types?

Output:

What are the two categories of JavaScript data types?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn