#25 of "Getting Started" - Error in Coding?


#1



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


I keep getting this error:
Oops, try again. It looks like you didn't log the length of myCountry to the console.

Here is what I typed in as instructed:

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

// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.substring(0,13));

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

When I click the "Save and Submit Code" button, the error message pops up even though the console shows the correct text...

So, I'm stuck at #25 and cannot move on until I - or someone sees - see what I am doing incorrectly...!


#2

here:

console.log(myCountry.substring(0,13));

you should log the length of of myCountry to console, remember .length? It gives you the length of a string or a string in a variable:

"see".length

would give you 3


#3

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