时间:2021-07-01 10:21:17 帮助过:11人阅读
$a=array(1,2,3); $b=array(1,2,3); echo ($a==$b); //output 是1 如果是 javascript 呢:请看以下代码返回的:
var a=['a','b','c']; var b=a; console.log(a==b); //outupt 是true
'; print_r($b); //Array ( [0] => 1 [1] => 2 [2] => 3 ) //Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 6 ) js代码: var a=['a','b','c']; var b=a; b[3]='d'; console.log(a); console.log(b); //output //["a", "b", "c", "d"] index12.html:12 //["a", "b", "c", "d"] index12.html:13