By the way Javascript works Im not sure if this is possible but I would like to debug Javascript much like debugging C# or/and Java; I put a breakpoint in a line and press (for example) F5 so it goes to the next line/function and pauses and keeps going each time I press a key.

Is there any way how to do this?

5 Years
Discussion Span
Last Post by riahc3

If you use Firefox with firebug, here is the explanation. If you are using Chrome, someone has posted the picture of where you can push the step-in button. If you are using IE, good luck.

Edited by Taywin


You can use debugger for setting breakpoints. it works like this:

var num1 = 0, num2 = 0, sum =0;
//set num1 to 4
num1 = 4;
//set num2 to 10
num2 = 10;
//here goes the debugger
debugger; //<--- code will stop right here
sum = num1 + num2;

Open your console then run the code: here's also a JSFIDDLE example i made: JSFiddle Example

Edited by gon1387


OK, debugger is working pretty good for now. Ill keep playing with that.

Thank you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.