## 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.

# Why does the user's score on this quiz always end up at 0?

Regardless of whether or not I put in the correct answer, I always end up with a score of 0 and no crown.

```var score = 0;

var answer1 = prompt("What is 1 + 1?");
var answer2 = prompt("What is 3 + 6?");
var answer3 = prompt("What is 2 + 2?");
var answer4 = prompt("What is 10 + 10?");
var answer5 = prompt("What is 5 + 9?");

score += 1;
}
score += 1;
}
score += 1;
}
score += 1;
}
score += 1;
}

document.write("<p>Out of 5 questions, you got <strong>" + score + "</strong> correct.</p>")

if(score === 5){
document.write("<p>Congratulations! You get the gold crown.</p>");
} else if (score === 4 || score === 3){
document.write("<p>Nice. You get the silver crown.</p>");
} else if (score === 2 || score === 1){
document.write("<p>Okay. You got the bronze crown.</p>");
} else {
document.write("<p>No crown for you!</p>");
}
```

And, of course, I managed to figure it out as soon as I posted this question! That's how it works, I suppose.

This is the code I should have been using to determine the score:

```if(parseInt(answer1) === 2){
score += 1;
}
score += 1;
}