Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 19th, 2012  |  syntax: None  |  size: 0.27 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function getMethods(obj) {
  2.   var result = [];
  3.   for (var id in obj) {
  4.     try {
  5.       if (typeof(obj[id]) == "function") {
  6.         result.push(id + ": " + obj[id].toString());
  7.       }
  8.     } catch (err) {
  9.       result.push(id + ": inaccessible");
  10.     }
  11.   }
  12.   return result;
  13. }