+ 2
How can I check js code step by step?
I want to see results each step
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
+ 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).
+ 2
It's a good idea to sometimes print the variables so you can see their values if you are having trouble with that.