https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/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 line
var a = 7;
var a = var b;

Your browser information:

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

Challenge: Storing Values with the Assignment Operator

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

The more information you give us, the more likely we are to be able to help.


You should only use var the first time you declare the variable, not every time you reference that variable.