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

I have a conditional which work by returning the right answer, but the quiz refuse it as good

var answer = prompt("What is the best programming language?");
if ( 'answer.toUpperCase()' === ("Ruby"); { alert"you are correct" }

Actually it is two days that I am stuck, because of this

3 Answers

Please can you try yoursel, I have this and I am blocked fo 2 days

var answer = prompt("What is the best programming language?"); if (answer.toUpperCase() === 'RUBY') { alert ("you are correct"); }

I think you want to replace the ";" for this part [if ( 'answer.toUpperCase()' === ("Ruby");] with a ")" and also remove the quotes around answer.toUpperCase like this:

var answer = prompt("What is the best programming language?");

if (answer.toUpperCase() === "Ruby") { alert("you are correct"); }

Though if that doesn't work could you leave a link to the page which has that challenge so I could try it there.

it doesn't work, thank you