Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the characteristics of js basic data types

Shulou Source: shulou.com Published: 2022-06-03 01:59:57 10月03日 Update

This article mainly explains "what are the characteristics of the basic data types of js". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what are the characteristics of the basic data types of js.

1. Basic data types are accessed by value.

That is, we can manipulate the actual value stored in the variable.

2. The value of the underlying data type is immutable.

No method can change the value of the underlying data type.

3. Properties and methods cannot be added to the basic data type.

4. the assignment of the basic data type is a simple assignment.

If you assign a value from one variable to another, a new value is created on the variable object and then assigned to the location where the new variable is assigned.

5. The comparison of basic data types is the comparison of values.

Values of basic types occupy a fixed amount of space in memory and are stored in stack memory.

Copy a value of the base type from one variable to another, creating a copy of the value.

Example

/ / explicitly declare the variables a, bvar a, b * / assign values to a, b using scientific notation, and their values should be 500a = 5E _ 2 * * b = 1.23 e * Thank you for your reading, the above is the content of "what are the characteristics of the basic data type of js". After the study of this article, I believe you have a deeper understanding of the characteristics of the basic data type of js, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Types data variables characteristics foundations learning memory content methods that is location copy size instance actual object that is attributes ideas Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple Microsoft macOS vpn