There are debugging options depending on your browser choice - I tend to use Firefox, so Firebug in my case. There is a question, what are the list options for other browsers - What is console.log and how to use it?
If the project you are working on has already adopted a mechanism for debugging, console.log() tends to be a simple and useful option when looking for a problem.
During debugging, you can use the approach to fail when entering a function, for example:
var myFunc = function(el) { console.log('Inside myFunc');
This will allow you to see what functions were called and give you a general idea of ββthe execution order.
You can also use console.log() to display the contents of variables - console.log(el);
Be careful to remove / disable console.log() calls as soon as you are done, as this may cause some problems during production.
source share