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 trialMiguel Rivas
1,182 Pointsmy code can run until the message variable!! Can somebody check this code and tell me what is wrong with it!!
alert("Let's do some math");
var number1 = prompt("what number is on your mind??");
number1 = parseFloat(number1);
var number2 = prompt ("Give a another number!!");
number2 = parseFloat(number2);
var message = "<h1> Math with numbers " + number1 + " and " + number2 "</h1>";
document.write(message);
2 Answers
anthony amaro
8,686 Pointshello Miguel. you are missing a + In your message variable
// you wrote
var message = "<h1> Math with numbers " + number1 + " and " + number2 "</h1>";
// it should be
var message = "<h1> Math with numbers " + number1 + " and " + number2 + "</h1>"; //
Jordan Faulds
Full Stack JavaScript Techdegree Student 2,315 PointsTHANK YOU for this. I didn't realize I needed to concatenate the closing header tag, and I was losing my mind trying to spot the problem.
Chris Goyette
2,910 Pointsomg. i forgot a plus after my first string. #MINDBLOWN.
Thank you!
Rich Donnellan
Treehouse Moderator 27,708 PointsRich Donnellan
Treehouse Moderator 27,708 PointsQuestion updated with code formatting. Check out the Markdown Cheatsheet below the Add an Answer submission for syntax examples.