Skip to content

Instantly share code, notes, and snippets.

@lifeart
Created July 14, 2017 22:49
Show Gist options
  • Save lifeart/ddb389c33aba12b180267d5d6991fea5 to your computer and use it in GitHub Desktop.
Save lifeart/ddb389c33aba12b180267d5d6991fea5 to your computer and use it in GitHub Desktop.
Get fn args name
function getArgs(fn) {
const str = fn.toString();
return str
.slice(str.indexOf('(')+1,str.indexOf(')'))
.split(',')
.map(e=>e.trim());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment