From the course: JavaScript Essential Training

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Troubleshooting JavaScript in the browser

Troubleshooting JavaScript in the browser - JavaScript Tutorial

From the course: JavaScript Essential Training

Troubleshooting JavaScript in the browser

- [Instructor] Writing JavaScript is one thing. Getting it to work properly is quite another. As you start writing your own JavaScript, you'll often run into issues you need to troubleshoot. You've already seen the most heavily used troubleshooting tool in action throughout the course. It's the browser console. Here you can log anything from your code into the console to see what's going on. And you typically do this if you're capturing values and then want to see what the values are before you start working with them. So here in this code example I am grabbing this variable called strapArray and I just want the console log it out to see what it is. I'm also a console logging out an element down here. And when I jump over to the console, you can see the output. We have a NodeList with some items in it and I can burrow into them. And I'm also getting the output I want. So this console log is used all the time to send…

Contents