25.More variable practice


#1

I am struggling with this, been trying for a while, maybe i am too tired but i will see who can help me with this. Thanks in advance to everyone who will reply to this.

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "South Africa";
myCountry.substring(0,11)

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

// Use console.log to print out the first three letters of myCountry.
console.log("South Africa").substring(0,3);


#2

It says two things when i make it like that.

1.SyntaxError: unexpected token ILLEGAL

2.Oops, try again. A quote is missing its pair on line 7. Check that the words are surrounded with a quote on each side.


#3

Hi here

console.log("myCountry").length"

First you should remove the " " around myCountry and the the length should be inside the console.log like that

console.log(myCountry.length)

And here

console.log("South Africa").substring(0,3);

You should put substring(0,3) inside the console.log too like that

console.log("South Africa".substring(0,3));

And I think that you dont need of that

myCountry.substring(0,11)

Remove it


#4

Thanks a lot for your help, i will make a note on this so i wont forget this.