I'm looking to do the equivalent of Python's inspect.getargspec()
in Javascript.
I do know that you can get the arguments
list from a Javascript function, but what I'm really looking for is the names of the arguments from the originally defined function.
If this is in fact impossible, I'm going to have to 'brute-force' it by getting the string of the function, i.e. myFunc.toString()
and then parsing out the ...
inside of function myFunc(...)
. Does anyone know how to do this parsing in a general way?
Thanks for any tips.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…