Help in 25, More Variable Practice


#1

I can't figure out why I can't pass this section
here's my code:
// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry =("America");

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

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


#2

We do not need to wrap strings in parentheses. They are already delimited by quotes.

var myCountry = "America";
 
// even though `America` is not a country but two continents combined.

We would never put quotes around a variable name. That makes it into a string primitive.

console.log(myCountry.length);

Same applies here... No quotes.

console.log(myCountry.substring(0,3))

We always up the end offset by 1 more than the end index.

A m e r i c a
0 1 2 3 4 5 6
0 1 2

#3

Thanks a million! I only misinterpreted the the reason of the second "console.log" , which baffels a person.


#4