Are you a QOTWer? Do you want to start a thread that isn't a direct answer to the current QOTW? Then this place, gentle poster, is your friend.
(, Sun 1 Apr 2001, 1:00)
« Go Back | See The Full Thread
Change the code so that word === "that" evaluates to true, and the console.log() command is run.
The code says
var word = "this";
if( word === "that" ) {
console.log( "word is equal to 'that'" );
}
(, Wed 11 Jan 2012, 20:28, 5 replies, latest was 14 years ago)
come on, I need help here, i need to get to the 4 achievements!
(, Wed 11 Jan 2012, 20:31, Reply)
var word = "that";
if( word === "that" ) {
console.log( "word is equal to 'that'" );
}
Let me know if I got it right, I'm off to bed now before my broadband dies yet again.
(, Wed 11 Jan 2012, 20:46, Reply)
But I don't understand the question entirely, "this" will never equal "that", unless you change "this" into "that" when declaring it or afterwards, such as
var word = "this";
word = "that";
if (word == "that") { console.log("word is equal to that"); }
Or
var word = "that";
if (word === "that") { console.log("word is equal to that"); }
The question they're doing is like saying "Change the sentence 'hello world' into 'goodbye world' " and then just awnsering "Change the world 'hello' to 'goodbye' ".
(, Wed 11 Jan 2012, 21:04, Reply)
word === "that" ..... that means "Strictly Equals", which is false, so won't run.
word !== "that" .... means "not equal", which it isn't, so therefore the statement is true.
You want to change === to !== or !=, both are fine.
(, Wed 11 Jan 2012, 21:15, Reply)
I got 350 points and 4 badges. I am an achievement whore
anyone else doing this?
(, Wed 11 Jan 2012, 21:29, Reply)
Nah, not worth the effort. Or, in fact, possible.
I'm doing the photo a day thing with scarpe and noel.
(, Wed 11 Jan 2012, 21:31, Reply)
I can help you if you need photo tips
(, Wed 11 Jan 2012, 21:42, Reply)
At the moment it's more 'here is what I did' than 'composed shot'. But there are quite a few days left in the year, so I may improve.
(, Wed 11 Jan 2012, 21:45, Reply)
« Go Back | See The Full Thread