1

I would like to see which JS functions are going to be run. Is there any way to see it?

For example, I have got a button with onclick event (which calls a function). After clicking, I would like to check which function has been run; if the function has invoked another one, I would like to see both.

3 Answers 3

1

In chrome browser, under developer console (You can get it using right click Inspect Element), sources tab -> Watch, Callstack, Scope, Breakpoints, Event Listeners may help your requirement.

You no need to add so many console.log instead while using break points in this developer console or similar, you can see the real time value of a variable or a function or an expression by just hovering your mouse pointer on it or add them to Watch list.

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

Comments

1

As far as I know, I don't think there is a way to do this (but I may be mistaken).

However, you can insert a:

console.log("[functionName] is running now!");

at the beginning of each function to see what is running. You can add a timestamp too to check when it started running.

Comments

1

You can use the dev tools in the browser you're using and set up breakpoints on the functions you want to check for execution. If you're on chrome, check out this guide.

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.