What is wrong?


var myCountry = String ;
console.log( myCountry.length);


okay, we have strings, which are wrapped in quotation marks ("):

"i am a string"

we can log a string to the console using console.log():

console.log("i am logged to the console")

now, we can also store strings in variables:

myVar = "i am a string"

now you log the string to the console using the variable name:


you can call length and substring on the variable (variable don't have quotation marks)

Hope this helps


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