+ 2

How can I check js code step by step?

I want to see results each step

5th Mar 2017, 6:56 PM
Andrey Gangan
Andrey Gangan - avatar
3 Antworten
+ 8
Use Chrome web developer tools: https://developer.chrome.com/devtools There is a tool for debugging you can use to start at a chosen line or to auto start the tools you can add "debugger;" in your code to where ever you want to start the debug tool. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger
5th Mar 2017, 8:29 PM
David Carver
David Carver - avatar
+ 5
create a debugging log in each step in your code console.log("whatever you want"); load the page and check the js console in the developer options (chrome/firefox).
5th Mar 2017, 7:15 PM
seamiki
seamiki - avatar
+ 2
It's a good idea to sometimes print the variables so you can see their values if you are having trouble with that.
5th Mar 2017, 7:15 PM
David Koplik
David Koplik - avatar