b3ta.com qotw
You are not logged in. Login or Signup
Home » Question of the Week » Off Topic » Post 1496045 | Search
This is a question Off Topic

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)
Pages: Latest, 837, 836, 835, 834, 833, ... 1

« Go Back | See The Full Thread

OK coders, I don't understand what this means
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)
Tits

(, Wed 11 Jan 2012, 20:30, Reply)
I don't think that's the right answer
come on, I need help here, i need to get to the 4 achievements!
(, Wed 11 Jan 2012, 20:31, Reply)
My best guess
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)
It's OK, guys, I got it

(, Wed 11 Jan 2012, 20:44, Reply)
Don't do it stictly, there is no need for that, a simple == is better and less likely to error.
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)
OHHHHHHHHHHHHHH, sorry, sorry, I got it.
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)
Week one complete!
I got 350 points and 4 badges. I am an achievement whore

anyone else doing this?
(, Wed 11 Jan 2012, 21:29, Reply)
Trying to better myself?
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)
that's still bettering oneself, unless you are already perfect at it
I can help you if you need photo tips
(, Wed 11 Jan 2012, 21:42, Reply)
Cool, that would be good.
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)
Whatcha doing?

(, Wed 11 Jan 2012, 22:26, Reply)

« Go Back | See The Full Thread

Pages: Latest, 837, 836, 835, 834, 833, ... 1