Skip to content

Instantly share code, notes, and snippets.

@oranj
Created August 23, 2012 19:51
Show Gist options
  • Save oranj/3440837 to your computer and use it in GitHub Desktop.
Save oranj/3440837 to your computer and use it in GitHub Desktop.
Get parameters of any non native functions
function getParameters(method) {
var sig = method.toString();
var matches = sig.match(/function\s*\((.*?)\)/);
if (matches == null || ! matches.length) {
return [];
}
return matches[1].split(/,\s*/);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment