Help With Coding!! (java)

wobblysafe

Honorable
Oct 6, 2013
2
0
10,510
Ok, so I am on this website code acadamy and this is what it is saying to do

Write code that contains an if/else statement, just like we did in the last exercise. When your condition is true, print to the console "I am right". When it is false, print to the console "I am wrong". Make sure your statement evaluates to false so it prints out "I am wrong"

and I typed this

if ("to".length === 4)
{"I am right"}
else {console.log;"I am wrong"}

and it says "Oops, try again! It looks like your conditional didn't log 'I am wrong' to the console"

when it DOES print I am wrong in the console... what did I do wrong!!
 
Solution
if this is java then -> System.out.print("I am wrong");

javascript is -> console.log("I am wrong");

i presume you mean javascript but you should be careful as they are very different things.
if("to".length === 4){
console.log("I am right");
} else {
console.log("I am wrong");
}

bigsmiler53

Honorable
Apr 3, 2013
1
0
10,520
if this is java then -> System.out.print("I am wrong");

javascript is -> console.log("I am wrong");

i presume you mean javascript but you should be careful as they are very different things.
if("to".length === 4){
console.log("I am right");
} else {
console.log("I am wrong");
}
 
Solution

wobblysafe

Honorable
Oct 6, 2013
2
0
10,510

Thanks.. haha, I cant beleive I forgot to put the console.log before the I am right thing, thanks!!