Problem in understanding of variables , any help would be apreciated

Tell us what’s happening:
any help i still understand how it works?
Your code so far

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

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

Your browser information:

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

Challenge: Assigning the Value of One Variable to Another

Link to the challenge:

Hey, in this one you don’t actually have to make two seperate assignments. Above your code you can see a = 7, by making b equal to a then you are also fulfilling he second test which is to make b equal to 7.

I also seen you’ve re-declared var a once a variable has been declared in this way (which it has already been above) then you can reference the variable by simply using it’s name, in this case a.

Hope this helps.

1 Like

thank you, ill try to figure out :slight_smile:

i really appreciate! now i understand and i got the answer… thank you!

1 Like

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