I`ve debugged a lot of code over the years, most of it my own . First learn to code to the standard, then learn when to break the rules. Every language has a beauty, embrace it. There are tools that will help along this path... finding the right editor or IDE is important for any language, for JavaScript I`ve found the -> -> evolution, followed by to be really instructive and useful.
©