创建一个原型对象为 null 的对象

index.js

const foo = Object(null);
const bar = Object.create(null);

console.log(foo instanceof Object); // true
console.log(bar instanceof Object); // false
console.log(Object.prototype.__proto__); // null

posted on 2021-09-09 10:37  aisowe  阅读(112)  评论(0编辑  收藏  举报

导航