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 trialDevanshi verma
1,307 PointsI am not able to get the prompt exercise in which I have to ask "what day is it?". can you help.
Please help I am getting Bummer again and again, my code is: var answer= prompt('what day is it?'); it is showing the dialouge box but showing the bummer.
var answer = 'what day is it?';
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="scripts.js"></script>
</body>
</html>
2 Answers
Guy Noda-Bailey
18,837 Pointsvar answer;
answer = prompt('What day is it?');
Try the code with two separate commands..... the first one to create the answer variable and the second to put data in it with the prompt.
(Also, be sure to capitalize the W in 'What day is it?')
Guy Noda-Bailey
18,837 PointsI can't see anything wrong with it. Except that the W isn't capitalized.
In terms of JavaScript syntax though, there is nothing wrong with declaring a variable and using a prompt in the same command.
Guy Noda-Bailey
18,837 PointsUpdate! I just tried the code challenge with the code you tried, it works fine if you capitalize the W.
Devanshi verma
1,307 PointsIt was showing the Bummer when I wrote it like that, may be because I was not capitalising W. Thanks for the help.
Devanshi verma
1,307 PointsDevanshi verma
1,307 PointsI need to ask something, why is it wrong to write like:
var answer= prompt('what day is it?');