關(guān)于數(shù)組連接時(shí)的數(shù)組名
為什么當(dāng)我把A= new Array("AA")改為C=new Array("AA")后,原來(lái)A變量的元素依然在輸出結(jié)果里(只是不隨C變量的變化而變化)?
script?type="text/javascript"> ????var?C=?new?Array("AA") ????var?B=?new?Array("BA","BB"); document.write(A.concat(B))??; </script>
2016-09-29
很簡(jiǎn)單!你聲明了一個(gè)變量,作為一個(gè)指向一個(gè)內(nèi)存位置(存儲(chǔ)單元),存儲(chǔ)“AA”?,F(xiàn)在你宣布C了。它是一個(gè)指針,表示同一存儲(chǔ)單元與A.
模式改變,但內(nèi)容不。
【百度翻譯】樓上的
2016-03-19
That's ?simple! You declared A as a variable quantity that pointed at a memory location(storage cell)that storaged "AA".Now you declare C again .It is a ?pointer that represents the same memory cell with A.
Mode changes,but content not.