<script language="javascript" type="text/javascript">
//创建变量testarray 并引用数组 ["1","2","3"]
var testarray = ["1","2","3"];
//引用数组 ,此时 变量 linkone linktwo testarray 均引用数组 ["1","2","3"]
var linkone =linktwo =testarray;
//修改testarray 引用数组 ["4","5","6"],此时 linkone linktwo 仍引用数组 ["1","2","3"]
testarray = ["4","5","6"]
//这里将返回 2
alert(linktwo[1]);
//创建变量testobj 并引用对象 {one:"1",tow:"2",three:"3"}
var testobj = {one:"1",tow:"2",three:"3"}
//引用对象, 此时objlinkone 引用 对象 {one:"1",tow:"2",three:"3"}
var objlinkone = testobj
//修改对象
testobj.tow="133"
//testobj引用新对象{one:"4",tow:"5",three:"6"} objlinkone仍引用原对象
testobj = {one:"4",tow:"5",three:"6"}
//这里将返回 133
alert(objlinkone.tow);
//strtest 引用字符串 im
var strtest = "im";
//strtestnew 引用字符串 im
var strtestnew = strtest;
//strtestnew 引用新的字符串 im new str
strtestnew += " new str";
//这里将返回 im
alert(strtest);
</script>