| 123456789101112131415161718192021222324252627282930313233343536373839404142 | <!DOCTYPE html><html lang="en"><head>  <meta charset="UTF-8">  <meta http-equiv="X-UA-Compatible" content="IE=edge">  <meta name="viewport" content="width=device-width, initial-scale=1.0">  <title>Document</title></head><body>  <script>    function deepClone(data) {      var tmp = {}      if (typeof data == 'object') {        // if(Array.isArray(data)){        //   tmp = []        // } else {        //   tmp = {}        // }        tmp = Array.isArray(data) ? [] : {}        for(key in data){          if(typeof data == 'object'){            tmp[key] == deepClone(data[key])          } else {            tmp[key] = data[key]          }        }      } else {        tmp = data      }    }    // var arr1 = [1,2,3]    // var person = {    //   name:'zs'    // }    // console.log(Array.isArray(person))  </script></body></html>
 |