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

0 points
Submitted by Madina.Ibrahim
almost 9 years

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

2 votes

Permalink

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(...)

points
Submitted by Codey P.
almost 9 years

Answer 553bc91e51b88756090007fb

2 votes

Permalink

// 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);

points
Submitted by OLESYA
almost 9 years

3 comments

Madina.Ibrahim almost 9 years

Thank you very much Olesya! It worked! You made me very happy!

Madina.Ibrahim almost 9 years

// 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);

Madina.Ibrahim almost 9 years

I deleted 3 line.

Answer 553addbc937676b0f5000131

0 votes

Permalink

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!

points
Submitted by Madina.Ibrahim
almost 9 years