26. What am I doing wrong?


#1
// On line 2, declare a variable myName and give it your name.
var myName = "Julia";
// 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.substring(0,2);
// On line 9, use console.log to print out the myName variable.
console.log(myName);

#2

This is the important part that you have missed.

Doing this doesn't change myName:

myName.substring(0,2);

Can you see how you might be able to change myName?


#3

Thank you so much!! :grinning:


#4

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

doesnt work


#5

Could you give me more details about why you feel that this doesn't work?