Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. //returns an array of methods
  2. Object.prototype.methods = function () {
  3. var m = [], k;
  4. for (k in this)
  5. if (typeof this[k] === "function") m.push(k);
  6. return m;
  7. };
  8.  
  9. Object.prototype.hasMethod = function (m) {
  10. return m in this && typeof this[m] === "function";
  11. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement