Dont know what is happening

Tell us what’s happening:

Your code so far


// Setup
var a;
var b = 2;

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

Your browser information:

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

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

Hi,

Could you provide more details? What exactly is unclear for you?

The assignment is:

Assign the value 7 to variable a .
Assign the contents of a to variable b .

//Setup
var a;
var b = 2;

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

I ran the test but it says " a should be assigned to b with = "
not quite sure what I have done wrong

I guess this happens because you’ve declared the b variable more than one time.

//Setup
var a;
var b = 2; // the first time here

// Only change code below this line
a = 7
var b = a // the second is here

Try to delete the var keyword from the statement var b = a and re-run the tests. (do not forget to add the semi colon onto the end)

Thank you very much for your help!