This forum is now read-only. Please use our new forums! Go to forums
error message:you have not set variable to console log? please help what am i doing wrong
// Declare a variable on line 3 called // myCountry and give it a string value. var myCountry=(“United States”.substring(0,13)); console.log(“United States”.substring(0,13)); console.log(“Uni”.substring(0,3));
Answer 54289642282ae353aa002166
1 vote
var myCountry=("United States".substring(0,13));
should be
var myCountry="United States";
AND
console.log("United States".substring(0,13));
should be
console.log(myCountry.length);
AND
console.log("Uni".substring(0,3));
should be
console.log(myCountry.substring(0,3));
The main thing to remember is that once you have declared your variable you should never retype the string. Always use and manipulate the variable. It’s about making the computer do the work.
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
1 comments
Thank-you