code: function getMethods(obj) {
      var result = [];
      for (var id in obj) {
          try {
              if (typeof (obj[id]) == "function") {
                  result.push(id);
              }
          }
          catch (err) {
              result.push(id + ": inaccessible");
          }
      }
      return result;
  }
docs: Created by Ma on 26/08/2014.