= Splice

Source: Internet
Author: User

1<script>2     functionWF (W) {3 Console.log (w);4     }5 6     varWA = [3,66,7];7     varWB =wa;8Wa.splice ();9 WF (WA);Ten WF (WB); One  A     varWaa = [3,66,7]; -     varWBB =Waa; -Waa = [123,4]; the WF (WAA); - WF (WBB); -  -     varWae = [3,66,7]; +     varWBE =Wae; -Wbe.splice (); + WF (WAE); A WF (WBE); at  -     vararr =NewArray (); - WF (arr); -</script>

[3, 7]
[3, 7]


[123, 4]
[3, 66, 7]

[3, 7]
[3, 7]

professional.javascript.for.web.developers.3rd.edition.jan.2012

4 Variables, Scope, and Memory

PRIMITIVE and REFERENCE valuesecmascript variables may contain the different types of data:primitive values and REFERENCE Values. Primitive values is simple atomic pieces of the data, while reference values is objects that may is made up of multiple Valu Es. When a value was assigned to a variable, the JavaScript engine must determine if it ' s a primitive or a reference. The five primitive types were discussed in the previous chapter:undefined, Null, Boolean, number, and String. These variables is said to being accessed by value, because is manipulating the actual value stored in the variable. Reference values is objects stored in memory. Unlike other languages, JavaScript does not permit direct access to memory locations, so direct manipulation of the object ' s memory space is not allowed. When you manipulate an object, you ' re really working on a reference to that object rather than the actual object itself. For this reason, such values is said to being accessed by reference.

= Splice

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.