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

Console.log

I still didn't get how to use console.log.. do you guys have any additional information for me?

1 Answer

You can use console.log for

  1. see some information as admin of site, something you don't want others to see. Like alert, or document.write, but only for you, not for visitors of your site. So you can preview information you want to put as alert first in console.log and after only change console.log to alert.
  2. For debugging if there's error in your document. Program shows you a line with error in the right side of error message.

To use it only click eye in top left corner of your document to preview it. It will open new page. Then click in top left corner three dots (if you using google chrome), search for more tools - developer tools. Second tab is console tab (after Elements), but there's others.

Hope it helps you to understand more.

Good answer.