How to get function parameter names/values dynamically?

前端 未结 30 2623
说谎
说谎 2020-11-22 00:13

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         


        
30条回答
  •  一整个雨季
    2020-11-22 00:33

    I don't know how to get a list of the parameters but you can do this to get how many it expects.

    alert(doSomething.length);
    

提交回复
热议问题