Object.prototype.looper = function() {
var result = [];
for (var property in this)
result.push(property);
return result;
};
var test = {name: "tab", age: 5};
console.log(test.looper());
如何消除活套以获取密钥
["name", "age", "looper", looper: function]
需要的输出
["name", "age"]