This forum is now read-only. Please use our new forums! Go to forums
Oops, try again. It looks like you didn't log the first 2 letters of your name to the console!
Lesson 26/28. Please help, I am getting message error: Oops, try again. It looks like you didn’t log the first 2 letters of your name to the console!
// On line 2, declare a variable myName and give it your name. var myName = “Madina”; console.log(myName); // On line 4, use console.log to print out the myName variable. console.log(myName); // On line 7, change the value of myName to be just the first 2 // letters of your name. myName = (myName.substring(0,2)); // On line 9, use console.log to print out the myName variable. console.log(myName);
The same message if I change line 7 to:
// On line 7, change the value of myName to be just the first 2 // letters of your name. myName = “myName”.substring(0,2);
Line 9 is not printing at all.
Answer 55391cf376b8fe5a3000023f
Hello Madina.lbrahim,
Read the error. Log. So that tells you that you are missing a return, or console.log. It would be console.log in this case.
Lets look over your code, line 7 doesn’t say to print, but it wants you to print. Try replacing the myName =
with a console.log(...)
Answer 553bc91e51b88756090007fb
// On line 2, declare a variable myName and give it your name. var myName = “Olesya”; // On line 4, use console.log to print out the myName variable. console.log(myName); // On line 7, change the value of myName to be just the first 2 // letters of your name. myName = “Ol”; // On line 9, use console.log to print out the myName variable. console.log(myName);
Answer 553addbc937676b0f5000131
Hello Codey, Thank you for help! I am getting the same error message.
Oops, try again. It looks like you didn’t log the first 2 letters of your name to the console!
But Line 9 gave print out.
// On line 2, declare a variable myName and give it your name. var myName = “Madina”; console.log(myName); // On line 4, use console.log to print out the myName variable. console.log(myName); // On line 7, change the value of myName to be just the first 2 // letters of your name. console.log(myName.substring( 0, 2)); // On line 9, use console.log to print out the myName variable. console.log(myName);
Madina Madina Ma Madina
Please help! Thank you!
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
3 comments
Thank you very much Olesya! It worked! You made me very happy!
// On line 2, declare a variable myName and give it your name. var myName = “Madina”; // On line 4, use console.log to print out the myName variable console.log(myName); // On line 7, change the value of myName to be just the first 2 // letters of your name. console.log(myName.substring( 0, 2)); // On line 9, use console.log to print out the myName variable. console.log(myName);
I deleted 3 line.