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

Nenad Marinkovic
Nenad Marinkovic
13,310 Points

I am stuck and don't know whats wrong with code, please help!

// Why it always say "Wrong!" Please, help me understand this. Thanks!

var correct = 0; alert("Welcome to My Quiz."); var questionOne = prompt("Capitol of Germany?"); if (questionOne.toUpperCase() === 'Berlin') { alert("Correct answer!"); correct += 1; } else { alert("Wrong!"); }

2 Answers

Nenad Marinkovic
Nenad Marinkovic
13,310 Points

Ohh, I figured it out. :) I just had to write "BERLIN" instead of "Berlin". But thanks anyways!

SAMUEL LAWRENCE
SAMUEL LAWRENCE
Courses Plus Student 8,447 Points

Yes exactly. sorry looked at your question late. Took me 3 days to get mines to work. so I didn't want to look at any questions during that time in case I found the answers without really trying.

Nenad Marinkovic
Nenad Marinkovic
13,310 Points

Thanks anyways, Samuel! Best.