Skip to content

Instantly share code, notes, and snippets.

@larsxschneider
Created March 30, 2012 13:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsxschneider/2251685 to your computer and use it in GitHub Desktop.
Save larsxschneider/2251685 to your computer and use it in GitHub Desktop.
Render all JS methods
function getMethods(obj) {
var result = [];
for (var id in obj) {
try {
if (typeof(obj[id]) == "function") {
result.push(id + ": " + obj[id].toString());
}
} catch (err) {
result.push(id + ": inaccessible");
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment