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 trialanthony cummings
9,961 PointsAt the end of this script after the document.write(), type the code required to print 'End program' to the browser's
This is what everyone else answered as I did.
<!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" + "End program" ):
</script>
</body>
</html>
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You're doing great, but you have a syntax error and you're printing out what they are asking for not once... but twice.
You have typed:
console.log("End program" + "End program" ):
This code contains a colon at the end of the statement instead of a semicolon which is producing an error. But assuming for a moment that it had been a semicolon, your code would print out "End programEnd program" to the console.
The line you're looking for is:
console.log("End program");
Hope this helps!
Rhys Kearns
4,976 PointsRhys Kearns
4,976 PointsYou are always too fast to respond! Can't keep up ;D
anthony cummings
9,961 Pointsanthony cummings
9,961 PointsMy code editor I've discovered are looking between atom, workspaces, sublime and etc. due to taking Treehouse course one after another on a Mac. The Safari, Google and Firefox will lock and sync on Apple's desktop when using big learning softwares like Lynda, Treehouse, Plurasjght, etc. The admin's are becoming of this issue.
anthony cummings
9,961 Pointsanthony cummings
9,961 PointsThanks Jennifer. But the prior question was misleading in that "print" and print to console is two different things. How or why would you end a program via console log command when it's purpose is to print to screen of the program. Very contradictory, but THANKS!!
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse Teacheranthony cummings To be clear, this challenge is checking if you can do it. But above and beyond that,
console.log
is used very often for debugging and testing purposes. Also, both of the steps of this challenge explicitly say to use the console:Given that there is only one way to print to the console, I fail to see how it is misleading. But that is just my opinion