Getting started with programming (More Variable Practice#25)


// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry="United States";
// Use console.log to print out the length of the variable myCountry.
// Use console.log to print out the first three letters of myCountry.

//My coding syntax is incorrect. ????


Notice there are no quotes on myCountry, but are instead on the string it represents? Anywhere we write this variable, we are representing the string, "United States".

console.log(myCounty.length);    // 13


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