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

Beth Osburn
PLUS
Beth Osburn
Courses Plus Student 344 Points

Console.log message did not appear when running this script console.log("Start Program");

What is error on console.log? console.log("Start Program"); alert("Help me fix this program!"); alert("Can you get this message to appear?"); document.write("<h2>My first JavaScript program</h2>"); document.write("<p>I'm practicing 'debugging'.</p>"); console.log("End Program");

Luis Magaña
Luis Magaña
13,042 Points

Hey there I copied your entire console log statements and everything worked perfectly, are you trying to do something else perhaps running all of these statements by calling the function "Start Program"? We need a little more definition to the problem and the cause thanks.

2 Answers

Steven Parker
Steven Parker
231,236 Points

Are you looking in the right place?

You know the log messages don't appear on the page, right? And they don't pop up like alerts do.

You can only see them if you have the developer's console open in your browser.

Anthony Mignona
Anthony Mignona
2,707 Points

As Steven Parker stated, it doesn't appear on the page, but in the browser's console (you can usually find it under developer tools).

Also, ensure your JavaScript file is linked to your HTML file by including it in your HTML page:

<script src="example.js"></script>