Help! : Storing Values with the Assignment Operator

Tell us what’s happening:

Your code so far

// Setup
var a;
var b = 2;

// Only change code below this list
myVar = 5;
myNum = myVar;

you have to add 
var a=7;
var b=7;
//b = a;```
**Your browser information:**

Your Browser User Agent is: ```Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36```.

**Link to the challenge:**

You have several issues here.

First, you should not be adding any of the following to your code, because the instructions do not tell you to add it and the “you have to add” is not code and causes an error.

myVar = 5;
myNum = myVar;

you have to add 

OK, now for what you are supposed to do:

  1. assign the value of 7 to variable a. You did that with var a = 7; but you do not need the var on the front, because variables are declared one time only and a was already declared at the top of the code (under // Setup).

  2. You have //b = a; commented out for some reason and instead went with var b=7, which again is not what the instructions asked you to do and you do not need the var in front either. See the following for now to assign the value of one variable to another.

var firstVariable = 10;

var secondVariable = firstVariable; // secondVariable is now 10
1 Like