数组里面有值,但是console.log出来后打开却是空

像遇到这种情况,很可能是深浅拷贝的问题,只要此时将赋值变为深拷贝,可能会解决问题
`newObj = deep(obj)

deep(obj) {
	let objName1 = JSON.stringify(obj),
          objName2 = JSON.parse(objName1;
     return objName2
}`

猜你喜欢

转载自blog.csdn.net/weixin_43565820/article/details/90081687