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
Mathilde Leo
1,669 PointsSimple if statement doesn't pass / issue with workspace?
Hi everyone,
I'm trying to pass the challenge of the Intro to conditional statements class. Task 1 passes, but then no matter what I do for task 2, I get the message "Oops, it looks like task 1 is no longer passing". Any help much appreciated! :)
var answer = prompt("What's the best programming language?");
if (answer.toUpperCase() === "JAVASCRIPT") { alert("You are correct"); }
1 Answer
geoffrey
28,736 PointsHi, You don't need to uppercase the word JavaScript. But what you need is to do the comparison whith the way the Javascript word is typed in the instructions. Just this way: JavaScript, then It'll pass.
ex:
var answer = prompt("What's the best programming language?");
if (answer === "JavaScript") {
alert("You are correct");
}
Mathilde Leo
1,669 PointsHaha, that was simple. Thank you! :)
Ivan Kusakovic
12,197 PointsIvan Kusakovic
12,197 PointsDon't delete what you have done in task1
Don't overwrite task1