Plz help me with no. 25


ive looked at every post that has an answer to 25 and ive copied it down. but it still wont work! plz point out any mistakes!

var myCountry = 'USA'
console.log('myCountry '.length);

thank you for taking the time to look at this:blush:


This line is correct, but missing a semi-colon at the end:

var myCountry = 'USA'

This line is incorrect since the variable is written between two quotes, making it a string primitive, not a reference.

console.log('myCountry '.length);

This line also has quotes, and it does not match the variable name. JS is case sensitive. "name" and "Name" are two different strings. myCountry and mycountry are two different variables.



I'm Stuck on the same thing but this is what I did:
// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry= "England" ;

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

And it doesn't seem to work :frowning:


Please read the above post about not using variables wrapped in quotes.