Is there a way to get the function parameter names of a function dynamically?
Let’s say my function looks like this:
function doSomething(param1, par
function getArgs(args) { var argsObj = {}; var argList = /\(([^)]*)/.exec(args.callee)[1]; var argCnt = 0; var tokens; while (tokens = /\s*([^,]+)/g.exec(argList)) { argsObj[tokens[1]] = args[argCnt++]; } return argsObj; }