This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by MrStealYaGirl
over 9 years

Oops, try again. There was a problem with your syntax. Help

// Declare a variable on line 3 called // myCountry and give it a string value. “myCountry”.length

// Use console.log to print out the length of the variable myCountry. console.log(“myCountry”.length) );

// Use console.log to print out the first three letters of myCountry. console.log(‘myCountry’.substring(0,3) );

Answer 544ab8588c1ccce4bf000a76

-1 votes

Permalink

The task in this lesson is to practice the use of variables.

“myCountry”.length

just give you the length of the Sring “myCountry” The declaring of the variable should look like: var myCountry = "someCountry"; . after that you could use the variable name as placeholder for the whole string:

console.log(myCountry.length) );
console.log(myCountry.substring(0,3) );
points
Submitted by Mr.Beer
over 9 years