Storing Values with the Assignment Operator Challenge

Storing Values with the Assignment Operator Challenge
0

#1

Tell us what’s happening:
Hello, please, can anyone help me? I’ve trying to solve this challenge and i haven’t been able to. Everything’s fine except for
"a should be assigned to b with ="
i thought that assigning the 7 to var b was the answer, and then i placed ‘‘var a;’’ to var b like it said but nope. I feel so dumb bc probably is an easy answer but i just can’t figured it out.

Your code so far

// Setup
var a;
var b = 2;

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36.

Link to the challenge:


#2

Once you declare a variable using the var keyword, you do not use the var keyword again for that variable. Instead, you just assign the variable a value with =.

The first instruction is "Assign the value 7 to variable a. You did that successfully with:

a = 7; // I removed the var because it is not needed

The second instruction is “Assign the contents of a to variable b.” When your wrote the following, you assigned the value 7 to variable b. That is not what the instructions said to do. After you make the correct assignment, variable b will contain the value 7, but not because you directly assign it the value 7.

b = 7; // I removed the var because it is not needed

#3

thank you!
I got the answer right, finally.