SOURCE

let obj = {
  name: "zhangsan"
}
console.log(obj) //{name: "zhangsan"}
let copyObjFn = (obj) => {
  let copyObj = {}
  for(let key in obj){
    copyObj[key] = obj[key]
  }
  return copyObj
}
let copyObj = copyObjFn(obj)
copyObj.name = "lisi"
console.log(obj) //{name: "zhangsan"}
console.log(copyObj) //{name: "lisi"}
console 命令行工具 X clear

                    
>
console