This forum is now read-only. Please use our new forums! Go to forums
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
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) );
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency