Languages
[Edit]
EN

JavaScript - get function argument names

7 points
Created by:
Giles-Whittaker
739

In this short article we would like to show sinmple way how to get function argument names in JavaScript.

getArgumentNames() usage example - JavaScript.
getArgumentNames() usage example - JavaScript.

Note: be careful, transpilation and compression may change argument names.

Practical example:

Note: above example code doesn't wor for code with placed comments inside function declaration (e.g. function /* note ... */ myFunction() { }). It is necessary to do some preprocessing to remove comments.

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join