Proper way to debug characters in javascript

When I write javascript code, I usually insert debug symbols to help me.

Let me illustrate what I mean, for example:

var debug = true;

/* Some event handler */
onValueChange = function(e, ui){
    var new_value = dom.volume.slider("value");
    conf.value = new_value;

    if (debug) {
        console.log("Value changed to : " + new_value);
    }
}

when I finish, I do not want all this debugging code to be part of my version / reduced code base. What is the convention for this kind of thing? Are there any tools (not based on IDE)? I am looking for solutions to work with the outgoing code base and to launch a new project in the future.

Or what other debugging strategies exist in the javascript world?

+4
source share
2 answers

, ! . console.log, , , , , Chrome DevTools. debugger;. .

+1

FireBug Fire Fox. java script.

+1

All Articles