V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  feipeng  ›  全部回复第 1 页 / 共 1 页
回复总数  2
自己想通了==
```
function Person(){
this.name = "张三";
}
let person = new Person();
person.age = 12;
```
上面的 person 就是一个非 plain object,person 的__proto__为 Person,在使用 for in 遍历复制之后的对象的__proto__却变成了 Object,显然复制前后不对等,故要使用 isPlainObject 方法进行过滤
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2276 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 06:17 · PVG 14:17 · LAX 23:17 · JFK 02:17
Developed with CodeLauncher
♥ Do have faith in what you're doing.