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 trial

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements The Conditional Challenge Solution

why am i getting a browser error on line 1

var correct = 0;

//questions
var qone = prompt("What is the most Famous phrase in typography");
if (qone.toUpperCase === "THE QUICK BROWN FOX JUMPED OVER THE       LAZY DOG") {correct+= 1;}


var qtwo = prompt("what is 2+2");
if (qtwo.parsInt === 4 ) {correct+= 1;}



var qthree = prompt("If you were going 80 mi per hour; how long would it take to 80 miles?");
if (qthree.toUpperCase()==="one hour"|| qthree.toUpperCase== "1 HOUR") {correct+= 1;}


var qfour = prompt("3+3");
if (qfour.parseInt() === 6) {correct+= 1;}


var qfive = prompt("5-5");
if (qfive.parseInt() === 0 ) {correct+= 1;}

//output results
document.write("<p> You got " + correct + "out of 5 questions correct.</p>")

//output rank

if ( correct === 5){
         document.write( "<p><strong>You earned a gold crown! </strong></p>");

5 Answers

You're most likely getting the "Unexpected end of input" error because you're missing a closing curly brace }. Assuming that you posted all of your code in when you posted your question, it appears that your last if statement does not have a closing brace.

Hope that helps!

I would like to thank you so much for your help

No problem, glad I could help!

Hi Jeremy! You need to pass in your string to the parseInt method. For example:

if (parseInt(qtwo) === 4) {
  correct += 1;
}

That should solve the issue. If not, let me know and I'll take another look.

no its giving me a syntax error on line 1 "Unexpected end of input" i don't even begin to understand what that means thanks for your help

thanks a million now i can continue to debug

I think there's a () missing in the line: if (qone.toUpperCase() === "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG") {correct+= 1;};

thank you