Please help I'm stuck with # 25


#1

var myCountry = "America";
console.log("myCountry".length === 9)
console.log("myCountry".substring(0,3))

I don't know whats wrong


#2

I think you are missing semicolons in line 2 and 3
And I am not sure about your === should that not be == ?


#3

I added the semicolon and took an equal away but it says that i didn't log the length of myCountry to the console


#4

Maybe you could try:

var myCountry = "America";
console.log(myCountry.length == 9);
console.log(myCountry.substring(0,3));

remove the quotes . They make it a string not a variable.


#5

This is what i put down and it worked:

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

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


#6

I see 2 things:

  • The string "America" is not equal to the length of 9, it is 7. Because of that you are not logging anything.
  • To complete this course you only need to log the length of your variable by using console.log("myCountry".length) you don't need it to set it equal to a number.

Hope this helps