- hasOwnPropery失效
var o = {
"id": 1
};
console.log(o.hasOwnPropery("id"));
错误信息
Hall.js:38 Uncaught TypeError: o.hasOwnPropery is not a function
at callback (Hall.js:38)
at XMLHttpRequest.xhr.onreadystatechange (Http.js:29)
不知道为什么不行, 后来改用
var o = {
"id": 1
};
console.log("id" in o);
网友评论