求解,数组赋值问题
var aa = 'aa' var bb = aa aa = 'cc' console.log(bb) 输出 ['aa'] //-------------------- var a = [ 'a' ] var b = a a[0] = 'c'
|
为啥同样的写法数组的值会被赋到 b 上面呢?
代码片段
var aa = 'aa' var bb = aa aa = 'cc' console.log(bb) 输出 ['aa'] //-------------------- var a = [ 'a' ] var b = a a[0] = 'c'
|
为啥同样的写法数组的值会被赋到 b 上面呢?
代码片段