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

michael radvany
380 PointsNext, in the app.js file, add the code required to print "Begin program" to the browser's JavaScript console.
What is the answer to this ?
index.html
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>JavaScript Basics</title> </head> <body> <script src="app.js"></script> </body> </html>
app.js
7 Answers

michael radvany
380 PointsOn app.js
console.log("Begin program");
alert("I am programming!");
console.log("End program");

Steven Parker
241,970 PointsYou need to add a bit of code in the app.js file to do the task asked for. Try reviewing the videos with this objective in mind, I'd bet they contain an example of the same thing being done.

michael radvany
380 Pointsits not in the videos can u show me how to do it ?

michael radvany
380 Points
Steven Parker
241,970 PointsLine 13 of the code shown in the JavaScript Challenge Solution video is an example of printing a message to the console.

michael radvany
380 Pointsi know what to write in it just not where to put it in the javascript challenge solution

Steven Parker
241,970 PointsThe challenge should have an HTML file and a JavaScript file on different tabs. Select the "app.js" tab to get to where the Javascript code should go.

michael radvany
380 Pointsit didnt work i wrote this
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>JavaScript Basics</title> </head> <body> <script src="app.js">console.log("Begin program")</script> </body> </html>

michael radvany
380 Pointsdo u have any suggestions ?

Steven Parker
241,970 PointsScript code can either go between tags or in a separate file. This particular challenge is apparently using the 2nd approach (I updated my previous comments accordingly).
One thing to watch for is the "src" attribute, which is used to load in a separate file (and would not be used when the code is between the tags).

michael radvany
380 Pointsit works now. thank you

Steven Parker
241,970 Pointsmichael radvany — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!

Husniddin Rahmatovich
Front End Web Development Techdegree Student 10,332 Pointsanswer console.log("Begin program");
Steven Parker
241,970 PointsSteven Parker
241,970 PointsThat looks OK, didn't it work?