Home > Web Front-end > JS Tutorial > body text

What are the two categories of JavaScript data types?

王林
Release: 2020-05-26 17:57:12
Original
4465 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!