Variables - More Variable Practice (25)


#1



https://www.codecademy.com/courses/getting-started-v2/4/1?curriculum_id=506324b3a7dffd00020bf661


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


#2

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


#4

Thank you so much! Your reply helped a lot!


#5

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