Stuck at 26


#1



Replace this line with your code. 

// On line 2, declare a variable myName and give it your name.
var myName = "Tony";
// 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);


#2

The part that's wrong is line 7. Console.log isn't a name you assign something to. Its a log statement that logs something to the console. For line 7, you need to take out console.log and change the value of myName to be just the first 2 letters of you name. Now, notice how it says letters, not numbers. You have numbers:

myName.substring(0,2);

It wants letters, or more specifically, the first two letters of your name.


#3

That's how substring works, you put in the index numbers of the letters in your string. Remember when we learned about substring? https://www.codecademy.com/en/courses/getting-started-v2/3/5


#4

Oh yeah, I remember now. Thanks for the reminder!:grinning:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.