I keep getting an error message when running the tests, no matter what I try I can’t pass a=b. I try using var a = var b with different spacing, and just using a =b. The other tests have passed to get b =7. I tried switching browsers as well. I’m stuck. Please help. The initial post for getting help is useless in my opinion. Unless we are supposed to combine the variables for the name it has nothing to do with this challenge.
Your code so far
// Setup
var a;
a = 7;
var b;
// Only change code below this line
b=7
var a = var b;
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36.
Challenge: Assigning the Value of One Variable to Another
but the solution is b = a. It sounds backwards to me. This isn’t the first time I have run into the test result not matching the exact answer
Thanks for your help!
I get what you mean by it sounding backwards. In JavaScript, = does not mean “is equal to.” Instead, you could say “has an assignment of.”
A variable is a storage container. You can picture a box in your head. You put things inside the box by assigning them. In this lesson, we have a = 7. That means that the box labelled a has a 7 inside it.
So when they tell you to “Assign the contents of a to variable b ,” another way to phrase that is “place ‘a’ inside ‘b.’” Now b will have a inside it, and a = 7, so now if you console.log b, the result will be 7.
Hope that helps.