25 more variables


// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "NewZealand";

// 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(myCountry.substring (0,3));

here is my code says I forgot to log the length of mycountry?


These two are not the same things:

myCountry   // is a variable currently set to  "NewZealand"
"myCountry"  // is a string containing the characters "myCountry"

Do you see the problem now?


the myCountry // is a var so it shouldn't be inside "XXXXX" it must be free

try but it this way

console.log(myCountry.substring(0,3)); // without "XX"


2 posts were split to a new topic: I'm having the same problem


2 posts were split to a new topic: 25. I am stuck here and cant seem to move forward


No myCountry is the variable, keep mycountry the variable.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.