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


#1

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

what is that wrong i am doing

var myCountry = "New York";

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

you declare the variable myCountry: var myCountry = "New York"; you want the length and substring of this variable, not of the string myCountry, so when using console.log, remove the quotation marks, this:

console.log("myCountry".length);

should become:

console.log(myCountry.length);

without the quotation marks (") .length is executed on the variable, if you do use quotation marks, .length is executed on a string called myCountry, same goes for substring


#3

Thank you stetim94 for the reply


#4

I am stuck @

var age = prompt("What's your age");
If (age <= 13)
{
confirm("I am ready to play");
}
else {
confirm("I am not ready to play");
}
plz correcet me


#5

please provide link to exercise, you should actually make a new topic