Am I the only person who didn't know that if you say
arrA = arrB then changing an element in arrA also changes the equivalent element in arrB.
Try this page:
<html><head>
<script language = "JavaScript" type="text/javascript">
function xx() {
var arrB = [];
arrB[0] = "AAA";
var arrA = arrB;
alert(arrB[0]);
arrA[0] = "trtrtrtrtr";
alert(arrB[0]);
}
</script>
</head>
<body>
<input type='button' onclick='javascript:xx()'>
</body>
</html>
arrA = arrB then changing an element in arrA also changes the equivalent element in arrB.
Try this page:
<html><head>
<script language = "JavaScript" type="text/javascript">
function xx() {
var arrB = [];
arrB[0] = "AAA";
var arrA = arrB;
alert(arrB[0]);
arrA[0] = "trtrtrtrtr";
alert(arrB[0]);
}
</script>
</head>
<body>
<input type='button' onclick='javascript:xx()'>
</body>
</html>