Please somebody help me to solve this

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

Your code so far

// Setup
var a; // The variable 'a' is assigned to b=
a = 7;
var b; 
// Only change code below this line

Your browser information:

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

Challenge: Assigning the Value of One Variable to Another

Link to the challenge:

1 Like

can you explain what is your problem with a little more detail.
the problem is pretty self-explanatory you must assign the value of the variable a to b.
Assignment is done by using the sign = , the left variable of the equal is going to have the value of the right side of the = sign . hope this helps you. You just have to do the same as you did with the literal value 7 but user a instead of it.

Maybe it helps changing the variables’ names:

// Setup
var RobAge; 
RobAge = 7;
var MarkAge; 
// Only change code below this line

How would you assing the ages such that MarkAge is always equal to RobAge?

If we do RobAge=7; MarkAge=7 then changing RobAge will not change MarkAge.

Hi @smd671167 !

I would reset the lesson because you are not supposed to change the setup code here

When you reset the lesson, the setup code should look like this

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

make sure to write your code where it tells you to.

// Only change code below this line

It might help to take a look at the example code again.

var myVar;
myVar = 5;
var myNum;
myNum = myVar;

You will notice how the last line assigns myVar to myNum

myNum = myVar;

You will need to apply that same concept to assign the contents of a to variable b .

Hope that helps!

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