4

Is there any function that can be used to list all of the currently defined functions in node.js? I'd like to create a function like this:

function getAllDefinedFunctions(){
    //return all the functions that are currently defined
}
1

1 Answer 1

3

You can use a for / in loop to loop over all properties in this (the global object) and check whether typeof this[name] is 'function'.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.