R4D
February 20, 2018, 12:49pm
1
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
pwkrz
February 20, 2018, 12:54pm
2
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!
R4D
February 20, 2018, 1:00pm
3
Doesn’t work
but thanks anyway
pwkrz
February 20, 2018, 1:12pm
4
Can you paste your current code?
macnick
February 20, 2018, 5:13pm
7
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.
R4D
February 21, 2018, 6:48am
11
// Setup
var a;
var b = 2;
// Only change code below this line
var a = 7;
var myVar = 7;
var b = myVar;
var myVar = a;
R4D
February 21, 2018, 6:53am
12
Thank you so much, ive spent 4 hours last night trying to fix.