Skip to content

Instantly share code, notes, and snippets.

@okeydoke
Last active August 29, 2015 14:16
Show Gist options
  • Save okeydoke/a2ac8b5ebfc757e3dd14 to your computer and use it in GitHub Desktop.
Save okeydoke/a2ac8b5ebfc757e3dd14 to your computer and use it in GitHub Desktop.
JS Object properties
function getAllMethods(object) {
return Object.getOwnPropertyNames(object).filter(function(property) {
return typeof object[property] == 'function';
});
}
console.log(getAllMethods(String).sort());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment