Problems with variables


#1

The only way to get past this exercise is if in line 4 I type
console.log("lamies")
and in line 9 I type
console.log("la")

but that makes no sense! Why else would I be declaring the value of myName then?
I had the same problem with myCountry in the previous lesson and when I ask for the length of myCountry it gives me the length of literally "myCountry" not the value I declared earlier


#2

Remove the " around the myName. When you use console.log("myName") you're saying it's a string so the console literally prints myName. When you put console.log(myName) it's a variable so it looks for what myName is equal to and prints that.


#3

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