Variables - More Variable Practice (25)


Oops, try again. It looks like you didn't log the first 3 letters of myCountry to the console.

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

// 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,3) );


Just remove the quotes from myCountry. We do not wrap variables in quotes. What they represent is already a string.


Thank you so much! Your reply helped a lot!


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