Javascript - How to clone an object?

前端 未结 8 1974
悲&欢浪女
悲&欢浪女 2021-02-18 22:28

I am confused. I create a copy from myObjOne, than i delete an entry from myObjOne and JS delete the entry in my copy(myObjTwo) too? But w

8条回答
  •  一个人的身影
    2021-02-18 23:07

    That is not how you clone, that is simply storing the same original object in an extra variable. Maybe this answer will help you

提交回复
热议问题