Artificial intelligent assistant

スプレッド構文での配列コピー時の参照について # javascript obj_aryobj_ary_copy const obj_ary = [ { 'aaa': 100 }, { 'bbb': 200 } ]; const obj_ary_copy = [...obj_ary]; console.log(obj_ary === obj_ary_copy); // false obj_ary["0"].aaa = 300; console.log(obj_ary_copy); // [{"aaa":300},{"bbb":200}] ← obj_ary_copy[0].aaa # ## 01 () ## 02 **** const obj_ary_copy = obj_ary;

## 01



`obj_ary === obj_ary_copy``obj_ary[0]``obj_ary_copy[0]`

****

## 02

****


const obj_ary_copy = obj_ary;


`obj_ary_copy``obj_ary`

`obj_ary[0] = {'ccc': 300};` `obj_ary_copy[0]``{'ccc': 300}``const obj_ary_copy = [...obj_ary];`

* * *

()

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 224a3e3fc1f2bdd2a5f4be9c17a0fa00