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

时间:2021-09-10 05:47:26   收藏:0   阅读:24

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

原文:https://www.cnblogs.com/aisowe/p/15245953.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!