#25 Trouble Please Help


#1

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.
console.log("Canada".substring(0,3));


#2

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!


#3

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


#4

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!


#5

can you just tell me what to do


#6

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.


#7

Thanks i took away the var and it worked


#8

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.


#9

It worked thanks a lot guys


#10

No Problem any time!


#11

it keeps coming up with a syntax error