NUM.19 Trouble


#1

I couldnt find this out and heres my code

(if ("Jon".length * 2 / (2+1) ===)
{
console.log("The answer makes sense!");
}
else{ "Error Error Error"}


#2

if someone answers thanks


#3

a couple things all on the same line of code.

(if ("Jon".length * 2 / (2+1) ===)
^                                ^
1                                2

1:

Take out the opening parenthesis there.

2:

The "===" is a comparison operator that sees if one thing is equal to another thing, you can't just have something equal blank. The console will just look at you like a confused cow! So finish whatever you were trying to do there or you could just do the following

if ("Jon".length === 3){
    console.log("The answer makes sense!");
}
else{ console.log("Error Error Error"); }

#4

Thanks :D:):D:):D:):D:):smiley:


#5

@lolman ur code wont work 4 me :frowning:


#6

thanks lolman had the 2 but forgot the 1 :smile:


#7

This was not foolproof code. I didn't test to make sure it worked, I simply put my knowledge into the code @hisack55 was using at the time. Maybe you could show me your code and I could try to help you out?


#8

Thanks it's work to me :smile:

if("Jon".length * 2 / (2+1) ===2 ){

console.log("The answer makes sense!");

}
else {
console.log("Error Error Error");
}