1. 什么是深拷贝什么是浅拷贝
      1. 深拷贝

        修改新变量的值 不会影响原有变量的值

        1. 默认情况下基本数据类型 都是深拷贝
        1. 浅拷贝 修改新变量的值 会影响原有变量的值 默认情况下引用数据类型都是 浅拷贝

    深拷贝:

    1. let num1 = 123;
    2. let num2 = num1;
    3. num2 = 666;
    4. console.log(num1) //123
    5. console.log(num22) //666

    浅拷贝:

    1. class Person{
    2. name = "lnj";
    3. age = 34;
    4. }
    5. let p1 = new Person();
    6. let p2 = p1;
    7. p2.name = "zs"; // 修改变量的值
    8. console.log(p1.name); //zs
    9. console.log(p2.name); //zs

    1`[~Y9AT}1`%%$WKQ}$VZUE.png](https://cdn.nlark.com/yuque/0/2021/png/1207969/1637490766211-48833deb-34d5-4e47-a075-1abc0d792e94.png#clientId=uc958d241-1279-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=277&id=ud100f960&margin=%5Bobject%20Object%5D&name=1%60%5B~Y9AT%7D1%60%25%25%24WKQ%7D%24VZUE.png&originHeight=553&originWidth=1115&originalType=binary&ratio=1&rotation=0&showTitle=false&size=422942&status=done&style=none&taskId=ude0f4bfe-4c40-4532-af3d-7e5602b09b7&title=&width=557.5)<br />![0NRUV~P7V0@~(_})]G]YP0A.png

    ![3VAMFEKL])FN~]M[4Q@R9.png](https://cdn.nlark.com/yuque/0/2021/png/1207969/1637490802344-53bfb57d-9ea2-4e80-aefe-997239db9cae.png#clientId=uc958d241-1279-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=217&id=u0a23c38e&margin=%5Bobject%20Object%5D&name=3VA%60MFEKL%5D%29FN~%5DM%5B4Q%60%40R9.png&originHeight=434&originWidth=1069&originalType=binary&ratio=1&rotation=0&showTitle=false&size=313907&status=done&style=none&taskId=ua640f901-1fcb-4e5f-869b-a6bf90451ca&title=&width=534.5)