Debugging your code in the web browser

Usually, you shouldn't get into a lot of trouble while coding the examples in this book. But, of course, in the typical day of any software developer, there will be many times where things go awry and where a good debugging session will help.

Let's see how you can debug web applications. This is a must-have skill for any developer out there, and there are many tools and solutions to help you figure out what your programs are doing.

The most basic debugging tool at your disposal is simply the console.log function, which you can use to log variables while your program executes. Although, it clearly isn't a panacea and far from a best practice, so you should use it sparingly for small checks. When your ...

Get Learn TypeScript 3 by Building Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.