#25 Trouble Please Help


This is what I put in and it keeps saying: SyntaxError: Unexpected token ILLEGAL and I can not figure
it out Please Help

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = ("Canada");

// Use console.log to print out the length of the variable myCountry.
console.log("var myCountry.length);

// Use console.log to print out the first three letters of myCountry.


First of all:

Dont post it on the Java section, this is a javascript so post it there.(Almost got me exited it was Java)

But secondly your problem was you had a misplaced quotation mark.

Here is your code:

And here is the correct code:

console.log(var myCountry.length);

Please Reply if it didnt work/help , as i will do my best to help you! Thanks!


i'm sorry for putting it in java section but it said: A quote is missing its pair on line 6. Check that the words are surrounded with a quote on each side


Oh Sorry i accidently copied the same code you had. I just edited the correct code in my above post. May you Check that again? If it dosent Work Reply to me saying so! Thanks!


can you just tell me what to do


Putting the var keyword in there will earn you a syntax error.

var creates a variable with no value, ie, it is undefined.

Asking for the length of something undefined will not work out well.


Thanks i took away the var and it worked


Oh my god thats the worst mistake.... albo dont judge me.

Swift do the changes @albionsrefuge told me to do and it should Work. Any Problems? Reply again.


It worked thanks a lot guys


No Problem any time!


it keeps coming up with a syntax error