Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1004 Bytes

File metadata and controls

28 lines (18 loc) · 1004 Bytes

Debugging front end JavaScript

console.log

A simple and relatively effective way to debug your front end JavaScript code is to add the console.log(var) to parts where you want to check if the output matches the expected value. Similar technique as adding break points to your code.

The console.log output is visible in browser's console:

For Google Chrome and Mozilla Firefox you can acceess the developer tools by pressing the Control+Shift+I (on Linux and Windows) or Command+Option+I (on Mac), and find the console tab.

Chrome Developer Tools

As a next a bit more advanced step, Chrome browser has by default integrated the developer tools to debug front end code more quickly and efficiently.

Regular expressions

To debug regular expressions on the fly, you can use the online free regex tool and debugger at Regext 101.

See alo