Javascrip Assignment

Tell us what’s happening:
I can’t seem to understand what to do,
I need to assign A to B, so I did (at least, that’s what I hope to do)
please help me understand :blush:

here’s my code so far:


// Setup
var a;
a = 7;
var b;

// Only change code below this line

b = 7;
a = b;

Thank you!

Your browser information:

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

Challenge: Assigning the Value of One Variable to Another

Link to the challenge:

You need to assign the contents of a to variable b.

Variable b is already declared for you but it has not been assigned any value yet.

So, the challenge wants you to assign another variable’s (in this case variable a) value to variable b. Here, you are not supposed to directly assign the value of a to the variable b like you did above. Follow the example given on the challenge to assign the value of variable a to variable b.

1 Like

Thank you very much! :slightly_smiling_face:
I tried it and succeeded
the answer is:

b = a;

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.