The test is as follows:
Array type test Object Type Test Test the instantiation function. Test the function parameter passing by address
Var a = B = [1, 2]; a. push (3); alert (a. length + ':' + B. length );
Impact on Node object operations:
Because the function is passed by value, when a node is inserted, the node itself is referenced, rather than its clone. Therefore, the node is transferred.
For example:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <meta http-equiv =" content-Type "content =" text/html; charset = gb2312 "/> <title> untitled document </title> <style type =" text/css ">. c2 {border: 1px solid # ccc; width: 100px; height: 100px ;}. c1 {border: 2px solid #000; width: 50px; height: 60px ;} </style> </pead> <body> div1 div2 <input type = "button" value = "append div1 to div2" id = "button"/> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
The last one is about removing the node. If we thought we would use innerHTML = "" to remove the element content, we will completely remove the created node from the memory in IE. This is not the case, however, a strange phenomenon occurs:
For example:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <meta http-equiv =" content-Type "content =" text/html; charset = gb2312 "/> <title> untitled document </title> <style type =" text/css "> body {font-family:" ", "Times New Roman", Times, serif; font-size: 12px ;}. c2 {border: 1px solid # ccc; width: 500px ; Height: 150px ;}. c1 {border: 2px solid #000; width: 300px; height: 100px ;}. c3 {border: 1px solid # ccc; width: 100px; height: 50px ;}</style> </pead> <body> <p> click add_div and inner again and again, it will find a strange phenomenon. Click alert and the created div is not cleared from the memory. The removeChild method works normally. </p> <input type = "button" value = "add_div"/> <input type = "button" value = "inner"/> <input type = "button" value = "remove"/> <input type = "button" value = "alert"/> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]