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 trialBenoit Tordeurs
Full Stack JavaScript Techdegree Student 9,400 Pointsif conditional follows by alert not working
var answer = prompt('What is the best programming language?'); if ( answer toUpperCase === ('Ruby'){ alert('you are correct')}
1 Answer
Osaro Igbinovia
Full Stack JavaScript Techdegree Student 15,928 PointsYou didn't construct your conditional statement properly. You're missing:
a full-stop to apply the 'toUpperCase' method to the 'answer' variable,
you didn't call the 'toUpperCase' method with a parenthesis(toUpperCase()),
a closing parenthesis after the test condition and,
a semi-colon at the end of the alert method.
if ( answer.toUpperCase() === ('Ruby')){
alert('you are correct');
}
As a bonus you don't need to wrap the string 'Ruby' in parenthesis, you can delete them.
Benoit Tordeurs
Full Stack JavaScript Techdegree Student 9,400 PointsOsaro, inserting, the quote above here if the Answer:Bummer! Compare with toUpperCase() === 'JAVASCRIPT'
I try to make up what's wrong , but I'm puzzle, THANK YOU
Osaro Igbinovia
Full Stack JavaScript Techdegree Student 15,928 PointsOh yea, silly me I forgot. It should be 'RUBY' not 'Ruby'
Benoit Tordeurs
Full Stack JavaScript Techdegree Student 9,400 PointsBenoit Tordeurs
Full Stack JavaScript Techdegree Student 9,400 Pointsit doesn't work