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 JavaScript Basics (Retired) Introducing JavaScript Using the Console

it looks like task is not passing

At he end of this script after document.write type the code required to print "end program" to the browser java script

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
  </head>
<script>
console.log("Begin program");
document.write("Welcome to JavaScript Basics");

</script>
</body>
</html>

8 Answers

Damien Watson
Damien Watson
27,419 Points

Hi Virginia,

The challenge states at the end of the script, so just before the '</script>'. Add a line of code to similar to the one that prints 'Begin program'.

The 'console.log' is a great way of outputting programatic information. We used to use 'alert' but this would interrupt the user experience. This is something you should write down and memorise as you will use it frequently. Try:

console.log("End program");

its not working can you show when i add the console after document.write its not working

Damien Watson
Damien Watson
27,419 Points

I just passed both using the following, compare what you have, it might be a simple character missing. Hope this solves it for you.

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script>
console.log("Begin program");
document.write("Welcome to JavaScript Basics");
console.log("End program");
</script>
</body>
</html>

its not working can you show when i add the console after document.write its not working

its not working can you show when i add the console after document.write its not working

its not working can you show when i add the console after document.write its not working

its not working can you show when i add the console after document.write its not working

its not working can you show when i add the console after document.write its not working

You seem to have done it correct, just remember the smaller things like the quotations inside the parenthesis and to close each line with the semi-colon. Also, the test didn't pass the first time for me because I forgot my uppercase 'B' on Begin program.

Hope I helped!