课程: JavaScript Essential Training

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

Troubleshooting JavaScript in the browser

Troubleshooting JavaScript in the browser - JavaScript教程

课程: 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…

内容