Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Introducing JavaScript The Console Challenge Answer

i do not understand for what they use the console.log??

i understand where i can find it. but that's it

3 Answers

Hey Rodi, as you learn more about JavaScript you'll find that console.log has many uses for helping programmers to keep track of what is going on in their code. It is a useful place for someone working with the code to see what is going on "behind the scenes" without displaying the content on the webpage itself. In addition, console.log is often used for debugging code since it allows you to see exactly which parts of your code are running correctly, and which are not.

You can use the console.log, to show that the program has "started" and "finished" so that you know there was nothing that was missed because the program made it to the last line! It's an awesome way to make sure everything ran!

You can also use console.log in mathematical operations to help you build bigger applications.