Here are the steps for getting function information.
Step 1 - Get the function object.
Step 2 - Get the information by iterating function object.
Here are the different ways for getting function object.
1. We can use function name with new to create object.
2. We can use window object and name of function in string with new to create object.
3. We can also use eval() function to convert the function name in string to code and then we can use new to create object. But eval() is considered unsafe and generally it is avoided.
We can use function name or window object to get the function object and then we can iterate function object to get properties and methods information.
We can use function name or window object to get function object. Then we can get method name as string in a variable. Then we can use () with function object and method to invoke a method.