instance method Function#argumentNames

View source on GitHub →

Function#argumentNames() → Array

Reads the argument names as stated in the function definition and returns the values as an array of strings (or an empty array if the function is defined without parameters).

Examples
function fn(foo, bar) {
  return foo + bar;
}
fn.argumentNames();
//-> ['foo', 'bar']
 Prototype.emptyFunction.argumentNames();
//-> []