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!
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
idriss ElouilaniCourses Plus Student 1,232 Points
create var answer; then usedti prompt() to ask "what day is ?" and store the answer variable
create var answer; used the prompt () method to ask user "what day is it "and store the result answer variable
var answer; var answer=("what day is it ?"); alert (answer); I wrote like this it doesn't through second Question
var answer; var answer= prompt("what day is it ?"); alert(sunday);
Henrik ChristensenPython Web Development Techdegree Student 38,322 Points
Just do it like this:
// just store the prompt inside the variable you created in task 1 var answer = prompt("What day is it?"); // and don't add the alert() because you was never asked to create it
Joseph Davidson8,667 Points
This is your solution:
var answer = prompt("What day is it?"); document.write(answer);
You do not have to declare the variable twice.
SP Prabhakar11,429 Points
- you cannot declare same variable name two times with "var" key.
- read question carefully, it would be "What" in place of "what". 3.your final answer would be var answer = prompt("What day is it?"); document.write(answer);