I cannot log my whole name to the console!


#1



https://www.codecademy.com/en/courses/getting-started-v2/4/3?curriculum_id=506324b3a7dffd00020bf661


I cannot fix this, Help!
Oops, try again. It looks like you didn't log your whole name to the console.


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


#2

"myName" and myName are not the same things.

One is a string consisting of the letters "myName" and one is a variable that currently has the value "janshi".

Use the one that you really mean to use.


#3

Thanks, that was fast


#5

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