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 trialGianfranco Amati
1,310 PointsWhat is the proper way to input the message? as I understood it should be either console.write(Im a Programmer) or alert
What is the proper way to input the message? as I understood it should be either console.write(Im a Programmer) or alert("Im a Programmer")
2 Answers
Joe Beltramo
Courses Plus Student 22,191 PointsIf you want to display something into a webpage the correct syntax is document.write
. The console
object does not have a write method, instead the console has a log method as the console is used for logging information. Alert's will give information to the user in a browser environment but it will not write to the page, it will give an 'alert popup' or 'alert dialog' that normally requires action for it to be dismissed.
Ari Misha
19,323 PointsHiya Gianfranco! Your question is a bit obscure coz "alert()" or "console.log" "outputs" something to the screen or console. And it should be "document.write()", not "console.write()"And im pretty sure "Im a Programmer" needs to be a screen. So yeah you need to make sure you're outputting a string. Do that and your challenge will pass, (: