Inspect the names/values of arguments in the definition/execution of a JavaScript function

While I can’t see any good reason for this,

var reg = /\(([\s\S]*?)\)/;
var params = reg.exec(func);
if (params) 
     var param_names = params[1].split(',');

assuming func is the name of your function

Leave a Comment