问题
Is there a way in js to list all the builtin functions and some info on their parameterlists? I couldn't really find anything about reflection to do this sort of thing
edit: The functions such as Math.sin are actually the ones I want to list, actually all built-in functions.
回答1:
Something like this, maybe?
for( var x in window) {
if( window[x] instanceof Function) console.log(x);
}
This will list all native functions in the console (excluding one in native objects, such as Math.sin()
).
来源:https://stackoverflow.com/questions/8693965/list-all-built-in-functions-in-javascript