13.Comparisions


#1

Here is my code

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

I am getting an error reportnig that the fourth console.log() call didn't print true.


#2

I'd hope not, you don't have a fourth..


#3

That's what I'm confused about :neutral_face:


#4

I'd interpret that as that it expects a fourth case. I'd check the instructions and/or reset to default code (obviously copy what you have first)

If there's really no hint of what the fourth one should be, give me a link at the exercise and I'll look closer at what it expects.


#5

Thank you, I will try your suggestion and let you know how it goes.


#6

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

Using this as my code has worked. Thank you for the advice. I ended up resetting the code. Not sure where that error came from lol.

I appreciate the help. :slightly_smiling:


#7

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

I Also used but idon't get logic and finally code works Fine


#8

Here I'll explain it for you.

The first line is comparing the length of Xiao Hui to be less than 122, which it clearly is.
The second is comparing the length of Goody Donaldson to be more than 8 which it is.
The third line is multiplying 8 by 2 which is 16 and the === is checking whether the result of 8*2 is exactly equal to 16


#9

console.log("Xiao Hui".length<122);
console.log("Goody Donaldson".length>8);
console.log(8*2===16);
in this code i am getting this error"Oops, try again. There was a problem with your syntax."
what to do?


#10

Hi try to refresh the page.


#11

thanks!!
its done ..