In this video, we learn how to use the console.log
method. This method prints a generic message to the JavaScript console. I mainly use it when debugging my code. I'll print out a message so that I know I'm in a specific function, or to check what the value of a variable is at a given point. I then delete them before going to production.
For the exercise portion of this course, you'll log the following to the console:
- Your Name
- Number of pizzas for your party
- An object that describes your favorite pizza
- An array of friends
- Multiple arguments: "My favorite pizza is", and the pizza object
Once you're finished, go on to the next video.