Lesson 25 - Variable not defined error


Hi Guys,

Having trouble in lesson 25 of JavaScript.

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

// Use console.log to print out the length of the variable myCountry.

// Use console.log to print out the first three letters of myCountry.

Yet I keep getting this error: "ReferenceError: myCountry is not defined"

I looked through this forum and it seems like I'm either blind or I did define the variable myCountry...

Thanks for any help!


no, you didn't, because when you define myCountry:

var MyCountry = "Czech";

you have the M uppercase, when you try to access the length and sub-string, you use lowercase m

variable names are case sensitive.


oh wow, I knew it would be something silly! Thank you so much for your help!