Here is Javascript quick tip debugger for Javascript developers, there is a debugger statement in JavaScript, which invokes any available debugging functionality. e.g setting a break point, and if there is no debugging functionality available the statement has no effect. Let’s say you wish to debug a function
1 2 3 4 5 6 7 8 |
var x = (function f() { var message = 'hello world'; if(typeof window.console !== 'undefined') { console.log(message); } else { alert(message); } })(); |
One could then add a debugger; […]