A = b problem symple resolution please help

Tell us what’s happening:
so far everything is working except:

" a should be assigned to b with ="

I place a = b but it doesn’t work

the instructions were Assign the contents of a to variable b

Your code so far


// Setup
var a;
var b = 2;

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0.

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

What the lesson is aiming to teach you is how variables are resolved before being assigned.

The way you wrote your code you are not really using this to your advantage, and not using the value that a is storing; you are “manually” assigning the same value to both.

Hope this helps :+1:

1 Like

Remember, variables have been declared in the setup section, You don’t have to declare the variables again. I mean, you not have to write var a or var b again. You o le have to asign the new values.

1 Like

ok I will simplify it moving forward, I didn’t know that if it was declared earlier it doesn’t have to be declared again, thanks I will be sure to not do that moving forward. but now for the final answer how do I assign a to be? I tried typing a = b but it doesn’t accept it at as answer

This means that a has the content of b; the challenge is asking you to

Assign the contents of a to variable b .

or b has the content of a.