A should be assigned to b with = help

Tell us what’s happening:
‘not sure what i’m doing wrong’

Your code so far


// Setup
var a;
var b = 2;

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36.

Challenge: Storing Values with the Assignment Operator

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator

Assign the value 7 to variable a .

Assign the contents of a to variable b .
you don’t need to set the value of b to 7
you only need to do excatly what is written above

You will only add two lines for this challenge. One line for the first instruction:

Assign the value 7 to variable a .

and one line below that for the second instruction:

Assign the contents of a to variable b .

when i remove b=7
i get, a should have a value of 7,
b should have a value of 7
and, a should be assigned to be with =

That is because you need to assign a to b and not b to a, which is what you were doing in the code you originally posted.

a=7
b=a
this still results in the statement, “a should be assigned to b with =”

Can you please post all the code showing in the editor?

Thank you.

1 // Setup
2 var a;
3 var b = 2;
4
5 // Only change code below this line
6 a=7
7 b=a

Don’t forget about using semi-colons.

That worked, thank you.