Basic JavaScript - Assigning the Value of One Variable to Another

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

Your browser information:

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

Challenge: Basic JavaScript - Assigning the Value of One Variable to Another

Link to the challenge:

Welcome to our community!

Variables a and b are declared: var a, and var b. The value 7 is assigned to a variable a. The instruction says that you should assign the contents of a to variable b. In other words, variable b should also have the value of 7, but you are not supposed to assign that number to b, but variable a.

So, to which variable is the variable b equal?

Welcome to the community!

This step asks that var a be assigned to var b.

It would be similar to

var j ;
var j = 10;
var k = j

k = 10 because var j prior to the assignment to var k was assigned 10.

I hope this helps you.

Happy coding! :slight_smile:

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