Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //returns an array of methods
- Object.prototype.methods = function () {
- var m = [], k;
- for (k in this)
- if (typeof this[k] === "function") m.push(k);
- return m;
- };
- Object.prototype.hasMethod = function (m) {
- return m in this && typeof this[m] === "function";
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement