Problems with variables


The only way to get past this exercise is if in line 4 I type
and in line 9 I type

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


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.


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