Why this code references different result

后端 未结 4 1371
眼角桃花
眼角桃花 2020-12-11 23:21

I am new to JS and was learning value and reference types in JS but I faced some confusion on the below code:

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 23:50

    You've just created z, which is a copy of obj.arr . If you change the value of z, the copy, the original (obj.arr) do not change.

    I'm French that's why my english isn't perfect

提交回复
热议问题