Storing Values with the Assignment Operator Question

Tell us what’s happening:
I have no clue why this is not working… from what I previously know, this is right.

Your code so far


// Setup
var a;
var b = 2;

// Only change code below this line
var 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/70.0.3538.102 Safari/537.36.

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

Because in the Setup part, a and b are declared. So in your codes, you do not need to declare the two variables with the key word ‘var’ any more.

once i took out the var, it still doesn’t work

I suggest using semi-colons. It is a good habit. I passed with the following.

1 Like

Yea, I tried this initially too but it still does not let me pass… Thanks for the semi-colon advice

Maybe reset your code and try again?

user-agent:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

From your initial screenshot it appears there could be an extra new line before the // Setup comment.

1 Like

I think it was the use of the semi colon that kept me from moving on. I re-loaded the page and used semmi-colons this time and it worked, thanks for your help!

1 Like