Proficient in Javascript references

Source: Internet
Author: User

proficient in Javascript this book covers the basic concepts and general methods of JavaScript. If you have time to learn it, it is still very good.
let's take a look at JS references. In general, JavaScript references are similar to C. There is no reference concept for specific values such as int, and references are applied to data types such as object and array. If you are interested, execute the Code below the example to see the result:

<SCRIPT type = "text/JavaScript" Language = "JavaScript"> var item = 1; var itemref = item; item = 2; alert ("int refrence result: "+ (item = itemref); var stritem =" ABC "; var stritemref = stritem; stritem + =" de "; alert (" string reference result: "+ (stritem = stritemref); var OBJ = new object (); obj. hasownproperty = false; var objref = OBJ; obj. hasownproperty = true; alert ("Object Reference Result:" + (obj. hasownproperty = objref. hasownproperty); var items = new array ("one", "two"); var itemsref = items; items. push ("three"); alert ("array reference Result:" + (items. length = itemsref. length); var itemsa = new array ("one", "two"); var itemsaref = itemsa; itemsa = new array ("three "); alert ("array new reference Result:" + (itemsa = itemsref); </SCRIPT>

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.