Closed jsonz1993 closed 7 years ago
@jsonz1993 如果Object.names
不存在,就会使用后面的方法
var getKeys = Object.names || function (obj) {
var names = [],name = '';
for (name in obj) {
if (obj.hasOwnProperty(name)) names.push(name);
}
return names;
}
对啊。但是 Object 应该是没有 names 这个方法的
@jsonz1993 😯是的呢,谢谢
Object.names 你应该是想用ES6提供的
Object.keys
手误写错吧。