Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A = {a:true}
- Object.keys(A)
- A.keys()
- Object.prototype.keys = function () {
- return Object.keys(this);
- };
- var foo = {};
- foo.keys(); // Array of enumerable key names, if any
- var bar = { keys: true };
- bar.keys(); // TypeError: not a function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement