For some reason its not recognizing that vaiable myCountry="USA" Any suggestions?
var myCountry = "USA"

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

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



myCountry is a variable not string

so dont need " "

and remember java and javascript are not the same


It should be (myCountry.substring(0,3)) because you are calling that variable and then performing the substring method on it. Also make sure to end everything with semicolons, that could be a problem if your not doing that in your actual program


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