Skip to content

Instantly share code, notes, and snippets.

@martinec
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinec/750aba6a22d556a36ee4 to your computer and use it in GitHub Desktop.
Save martinec/750aba6a22d556a36ee4 to your computer and use it in GitHub Desktop.
Display all methods in a JavaScript object
/**
* Enumerate all methods in a Javascript object (ES5)
* @source http://stackoverflow.com/a/2946616
*/
function getAllMethods(object) {
return Object.getOwnPropertyNames(object).filter(function(property) {
return typeof object[property] == 'function';
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment