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

fatimah Alabbad
fatimah Alabbad
1,972 Points

I did everything as instructed but the console did not appear , what's wrong with my cod ?

here is the code I wrote : https://w.trhou.se/bt7b6e5at

Can't view your code, could you post here?

fatimah Alabbad
fatimah Alabbad
1,972 Points

console.log("Begin 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");

2 Answers

Can you show me what is outputted in the browser?

You should only see

Begin program end program

This is because document.write doesn't output to browser consoles.

fatimah Alabbad
fatimah Alabbad
1,972 Points

I fixed it ^^. I was using chrome canary and change it to chrome and it appeared. maybe their was some catches or something, but thanks anyway.

You're welcome

Your code is absolutely fine. When you preview (using the eye icon in the corner) it loads in new browser tab.

If you right click on the webpage that loads and select Inspect, you will see the messages in the console of the browsers dev tools.

Hope this helps

fatimah Alabbad
fatimah Alabbad
1,972 Points

I opened the browser before and all the other codes appeared and the console.log did not appear in the console area