Storing Values with the Assignment Operator plz help

Tell us what’s happening:

So I assigned A = B
and it still gives me the error that I have to assign a to b
wtf

Your code so far

// Setup
var a;
var b = 2;

// Only change code below this line
var a = 7;
var bNum = 5;
var b = (bNum + b);
var a = b;

Your browser information:

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

Link to the challenge:
https://www.freecodecamp.org/challenges/storing-values-with-the-assignment-operator

Hi R4D,

I think the instructions may be a little confusing. What they want you to do is:

a = 7;
b = a;

Note that you shouldn’t use “var” after the first declaration.

Hope this helps!

Doesn’t work
but thanks anyway

Can you paste your current code?

look up its in the name

i mean in the title …

Hello R4D,

Assignment always goes from right to left. Everything to the right of the = operator is resolved before the value is assigned to the variable to the left of the operator.
Please check your code.

pwkrz gave the correct answer.

// Setup
var a;
var b = 2;

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

Thank you so much, ive spent 4 hours last night trying to fix.

yeah, thanks …