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 trialVirginia Chubo
1,182 Pointsit 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
<!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
27,419 PointsHi 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");
Virginia Chubo
1,182 Pointsits not working can you show when i add the console after document.write its not working
Damien Watson
27,419 PointsI 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>
Virginia Chubo
1,182 Pointsits not working can you show when i add the console after document.write its not working
Virginia Chubo
1,182 Pointsits not working can you show when i add the console after document.write its not working
Virginia Chubo
1,182 Pointsits not working can you show when i add the console after document.write its not working
Virginia Chubo
1,182 Pointsits not working can you show when i add the console after document.write its not working
Virginia Chubo
1,182 Pointsits not working can you show when i add the console after document.write its not working
Charles Cunningham
7,322 PointsYou 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!