其他分享
首页 > 其他分享> > 没有原型的对象也是存在的

没有原型的对象也是存在的

作者:互联网

let xj={name:"xiangjun"};
console.log(xj);
console.log(xj.hasOwnProperty("name"));

//完全数据字典对象
let hd2=Object.create(null,{
    name:{value:"houdunren"}
})
//没有原型的对象也是存在的
console.log(hd2.hasOwnProperty("name"));//axioshtml.html:724 Uncaught TypeError: hd2.hasOwnProperty is not a function

 

标签:xj,存在,console,name,对象,原型,hasOwnProperty,log,hd2
来源: https://www.cnblogs.com/yyy1234/p/15841275.html