Stuck on lesson 26. What did I do wrong?


#1



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


Replace this line with your code.


#2

So your problem is here. Why do you have a substring? All for this line you just need your variable myName to equal the first two letters of your name so Tr. It would look something like this:

myName = "Tr";

#3

@bibleman13 is right, they're trying to make you understand overwriting variables and the such. But awesome job trying to use substring!


#4


Dang flabbit! You're winning, but we're officially best friends!


#5

Well good! I appreciate the mutual rivalry and friendship lol I think it wont be tied for long by the look of my notifications lightening up as I type this. I will admit I was wondering what in the world I did to deserve all those likes but also I think this is better meant for a message or another topic. We be distracting this poor fellow from his solution xD


#6

// On line 7, change the value of myName to be just the first 2
The code should be like this
var myName="tr"
Here don't use substring.


#7

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