javascript--variable

Source: Internet
Author: User

This article briefly describes the data types of JavaScript variables, as well as variable type detection and type conversion

First, Introduction

There are 6 types of data for JavaScript variables, including 5 primitive types and 1 object types. I prefer to use logical graphs to summarize the knowledge points, so more clear, the figure is as follows:

Second, note: 1, variable assignment

Reference type: As long as no new is allocated memory space, so when you copy the value of a variable in an assignment, a pointer to the object is copied, and two variables refer to the same object

2. Function Transfer parameter

The parameter passing of a JavaScript function is passed by value , except that the value of the reference type is a pointer, so the change reacts to the outside of the function.

javascript--variable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.