I'm stuck, i don't know how to set a to equal b

Tell us what’s happening:

Your code so far

// Setup
var a;
var b = 2;

// Only change code below this line
var a = 7;
var b = 7;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36.

Link to the challenge:

Do same thing like myVar and myNum in the content that introduce the challenge

1 Like

Good morning,

In the same way that you set the value of a to 7, you can also set the value of variables to other variables.

For example, if i had two variables (x and y), i could do the following:

x = 5; // x = 5
y = x; // y = 5
1 Like

Hi @amypolito.
After a variable has been declared (when you do var a…) you shouldn’t declare it again (basically you shouldn’t put the var word before it).
What you can do, though, is assigning it a value (which you do with the assignment operator “=”).
The part on the left of the = is the variable that will get a new value.
The part on the right can be an expression that will be evaluated. The result of this evaluation will be the new value for the variable on the left.