Help On comparisons? 13. on Getting Started with programming


#1

Try to use each of the operators above.

Choose the correct comparison operator to make each of the four statements print out true.

// Here is an example of using the greater than (>) operator.
console.log(15 > 4); // 15 > 4 evaluates to true, so true is printed.

// Fill in with >, <, === so that the following print out true:
console.log("Xiao Hui".length 122);
console.log("Goody Donaldson".length 8);
console.log(8*2 16);


#2

You have to say if the number or the name's length is greater, less, or equal to each other.


#4

Do it something like this:

console.log("Goody Donaldson".length ___ 8);
console.log(8*2 ___ 16);

In these "___" I put, you're supposed to put either "<", ">", or "===".
So Xiao Hui.length is obviously less then 122, right? Because there isn't 122 words in Xiao Hui. So this is what you would do:

console.log("Xiao Hui".length < 122);

Hope it helped!:smiley:


#5

Hi, I'm having problems with this one, I've put the following in:
console.log("Xiao Hui".length < 122);
console.log("Goody Donaldson".length < 10) ;
console.log(8*2 16) < 5;

Keep getting SyntaxError: missing ) after argument list, not sure if bracket or < . in the wrong place


#6

Hey @codeplayer88578,

It's because of this:

You were supposed to put the <,>,or === between the 8*2 and the 16. :smiley:


#7

console.log("Xiao Hui".length<122);
console.log("Goody Donaldson".length>8);
console.log(8*2 === 16);