What is wrong? Do you know?

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

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

Your browser information:

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

Challenge: Assigning the Value of One Variable to Another

Link to the challenge:

Why are you redeclaring a with var? You should never redeclare a variable. You don’t need that line.

And reread the line, “Assign the contents of a to variable b .” You have misunderstood the direction. (Granted, it is a little confusing.)


Stop reassigning a variable.
Check the example.
a is already defined. And the number should not be directly assigned to b.

1 Like

Thank you, I’m already making a mistake.
You need to do this:
war b;
b = a;

I’m not clear. Are you asking me or telling me?

If you are still having trouble, please post the complete code.

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