26.Change Variable Values


// On line 2, declare a variable myName and give it your name.
var myName = "Adam";
// On line 4, use console.log to print out the myName variable.
// On line 7, change the value of myName to be just the first 2
// letters of your name.
// On line 9, use console.log to print out the myName variable.

So this is what I have but the consoles not logging my Variable, I've looked around, reset, and refreshed multiple times I don't get it. This should be correct, am I wrong?


These two things are not the same:


Do you want to use a variable or a string consisting of the letters "myName"?


lol thank you very much :slight_smile:


well I thought I had it I'm just trying to create a variable and define it, then have that variable log in the console as a couple strings and a substring


This is perfect:

var myName = "Adam";

This is not, unless your goal is to log the letters "myName":


Do you understand how to fix that?


got it thanks a bunch feel pretty dumb just started this, goes from being super easy to getting stuck on something silly. Now that I think about it it seems so obvious lol. I am enjoying learning it though


as long as you learn....don't worry.


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