Create GSwP- 26 of 28

// 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.
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);


/*

The myName variable is declared as Adam
The console.log function then Outputs the myName varible = Adam
Then myName is changed from Adam to Adm using the substring function to select the first three letters of the variable myName (Ad) and then assign this to the varible myName - this then changes the varible myName to Adm
Then the variable myName is Outputted using the console.log


Output:

Adam
Ad


From codecademy.com


Change variable values

So far, we've seen
a. how to create a variable
b. how to use a variable

Let's now see how to change a variable's value. A variable's value is easily changed. Just pretend you are creating a new variable while using the same name of the existing variable!

Example:

var myAge = "Thirty";
Say I had a birthday and I want to change my age.
myAge = "Thirty-one";

Now the value of myAge is "Thirty-one"!

Instructions
Follow the instructions on line 1, line 3, line 5 and line 8. We're using this method to show you the order in which you tell the computer what to do is very important.


From codcademy.com


*/