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.
There are 3 ways of writing a function in JavaScript: Function Declaration. Function Expression. Arrow Function.
Built-in functions are ones for which the compiler generates inline code at compile time. Every call to a built-in function eliminates a runtime call to the function having the same name in the dynamic library.
A function in JavaScript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output.
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()
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With