Need help with question 25


#1

Hello everyone, I'm stuck on lesson 25 in adding in my country as a variable and substring of the variable. Can you advise me on what I'm doing wrong? Thank you!

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

Error message: Oops, try again. It looks like you didn't log the length of myCountry to the console.

Replace this line with your code.


#2

can you please post your code so we can see it?
with this link we cant see your code.

Error message: Oops, try again. It looks like you didn't log the length of myCountry to the console.

this error message says you didnt print the length of myCountry


#3

hey rcodeman thanks for your help, I figured out my issue!

here's the code:

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "United States";
"United States" .substring(0,13)

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


#4

most welcome :slight_smile:

in your code

"United States" .substring(0,13)

you don't need it


#5

but is invaluable in any question post. Glad it is included.


#6

Be sure there is no white space before the DOT in the dot notation. It is a chain that is broken by spaces.


#7

4 posts were split to a new topic: Looks like you didn't log the length of myCountry


#8

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