25.More variable practice


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";

// Use console.log to print out the length of the variable myCountry.

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


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.


Hi here


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


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


Remove it


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