相关疑难解决方法(0)

如何动态获取函数参数名称/值?

有没有办法动态获取函数的函数参数名称?

假设我的函数看起来像这样:

function doSomething(param1, param2, .... paramN){
   // fill an array with the parameter name and value
   // some other code 
}
Run Code Online (Sandbox Code Playgroud)

现在,我如何从函数内部获取参数名称及其值的列表到数组中?

javascript reflection function-parameter

282
推荐指数
14
解决办法
16万
查看次数