More Variable Practice: Exercise 25


Can someone please tell me what is it that I'm doing wrong? I followed the instructions in the comments:


Remove the quotes from around the variable name, myCountry. It is not a string, but a reference to one.

var myCountry = "Canada";

and so on.


@mtf, according to the editor, your code is saying it's wrong. All I'm trying to do is make "myCountry" print out that it is a string.

Do you have anymore suggestions?

All I'm trying to do is perform what the comments are asking me to do...


You're only logging the result of "myCountry".length === 9, which is true, rather than logging the actual length of the variable's value, which would be "America", resulting in 7. You also need to remove the quotes around myCountry in line 9, so that you get the substring of the value of myCountry ("America"), rather than the first three letters of "myCountry":

var myCountry = "America";
console.log(myCountry.substring(0, 3));


Thanks @jibblyj! After a couple of tries in performing of what you said, I got it right. At first, your directions weren't working...


I'm glad you got it working.


Thank you so much! I had this same problem! I am so glad! I finally got to the next lesson! Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :grinning: