feipeng 最近的时间轴更新
feipeng

feipeng

V2EX 第 290947 号会员,加入于 2018-02-09 14:22:59 +08:00
feipeng 最近回复了
自己想通了==
```
function Person(){
this.name = "张三";
}
let person = new Person();
person.age = 12;
```
上面的 person 就是一个非 plain object,person 的__proto__为 Person,在使用 for in 遍历复制之后的对象的__proto__却变成了 Object,显然复制前后不对等,故要使用 isPlainObject 方法进行过滤
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4829 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 09:44 · PVG 17:44 · LAX 02:44 · JFK 05:44
Developed with CodeLauncher
♥ Do have faith in what you're doing.