先自测一下,答案在最下边。

<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){

var a = 5;
var b = a;
alert(b);
a = 10;
alert(b);

var arr_a =[];
arr_a[0] = 0;
var arr_b = [];

arr_b = arr_a;
alert(arr_b[0]);

arr_a[0] = 10;
alert(arr_b[0]);



});
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">Click me</button>
</body>
</html>

运行结果弹窗显示依次是:

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

5 5 0 10

01-24 11:17