2

I want to get a list of argument names of Function, for example:

var f = (a, b, c) => console.log(a, b, c);
var [fargs] = something.like.inspect.getargspec(f);
console.log(fargs); // ['a', 'b', 'c']

1 Answers1

1

If you're using Node and want the argument names, check out the introspect NPM module:

> var introspect = require('introspect')
> var f = (a, b, c) => console.log(a, b, c);
> console.log(introspect(f))
[ 'a', 'b', 'c' ]
Mark Reed
  • 91,912
  • 16
  • 138
  • 175