Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Introducing JavaScript Let's Make a Game Introducing Code Challenges

In the first code challenge I just noticed the html output of the task. What about console.log('Hello, World!'); code?

What the console.log('Hello, World!'); code in the app.js script is used for? I coundn't see any output from this code snip.

<!DOCTYPE html>
    <title>Welcome to Treehouse Code Challenges!</title>
    <p>This is a webpage from inside a code challenge</p>
    <script src="js/app.js"></script>
console.log('Hello, World!');

2 Answers

It writes 'Hello world' in the console. To view this right click the page and press inspect and then hit console on the top navigation bar. It should be printed in there.

Jason Anders
Jason Anders
Treehouse Moderator 145,704 Points

Hi there,

That line of code will log "Hello, World!" to the console. It will not be seen on the site, but if you open the Developer Tools in the browser, inside the console you will see Hello, World!.

Hope that helps. :) :dizzy: