Lesson 26 - It's saying that I didn't log my whole name into the console


#1

Hello.

I have no idea what I am doing wrong. I read other conversations about this lesson, and I put in the code that other people said worked for them. Can someone help me?

var myName = "Jessica";

console.log(myName.length);

myName.substring (0,2);

console.log(myName);


When I submit the code, it says that I am not logging my whole name into the console. I'm at my wit's end. Please help!


#2

@jgreen629,

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

JavaScript: what is wrong with this code?
#3

@leonhard.wettengmx.n

Hello.

Your code passed. Thanks for the help!

-jgreen629


#4

its broken i tried to do it but nothing even copy paste didnt work... im trying it like 3 hours straight already but no solution


#5

Have you managed to work it out. Leon's solution has helped me.


#6

your code passed mine too, thank you very much for helping out around codeacademy