javascript-Data Reference type Object

Source: Internet
Author: User

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title></title>67<body>8<script>9     //Pass by value: When you assign a value between two variables, or pass a variable as an argument to a function, you copy only one copy of the value from the original variable to the other.Ten     //value of the original type: Modify the new variable without affecting the original variable One     varA=3; A     varB=a;//a copy your value to a copy to B -a++; -Console.log (b);//3 theConsole.log (a);//4 -     //object of reference type: Modify the object with the original variable, and the new variable is also affected. Because two variables refer to the same object -     vardd=[' package ', ' package ', ' package ', ' package ', ' package ']; -     varxx=DD; +dd.length--; -Console.log (String (xx));//4 +Console.log (String (DD));//4 A</script> at</body> -

javascript-Data Reference type Object

Related Article

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.