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 trialCarleen Hall
Front End Web Development Techdegree Student 3,158 PointsWhy is it that the number "3" is not showing up in my prompt? Please help!
Here is my code. Hope the link work this time around. Thanks.
var questions = 3;
var questionsLeft = "[" + questions + "questionsLeft ]";
var adjective = prompt("Please type an adjective " + "questions left");
var sentence = "<h2>There once was a " + adjective;
var noun = prompt("Please type an noun");
var verb = prompt ("please type a verb")
alert("All done, let's what you came up with")
sentence += noun + "who know how to code she was so happy, she started ";
sentence += verb + "she was up all night.";
document.write(sentence);
2 Answers
Matthew Carson
5,965 PointsI'm going to guess you want the 3 to appear on the third line.
You aren't concatenating the questionLeft variable in the prompt string.
You set the questionsLeft variable to "[3questionsLeft ]"
Doing this:
var adjective = prompt("Please type an adjective " + questionsLeft);
Would return a prompt with:
Please type an adjective [3questionsLeft ]
Carleen Hall
Front End Web Development Techdegree Student 3,158 PointsOh boy! can't believe i missed that. Thanks Matthew.
tobiaskrause
9,160 Pointstobiaskrause
9,160 PointsPlease create a snapshot of your workspace. We can not access your workspace with your link