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
var a;
b = 7;
var abc;

Your browser information:

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

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

Link to the challenge:

Ok it might seems a bit confusing at first but let me try to make it easy for you or at least I could try.

At first we are declaring variable name which is var a; now we have a variable with a name a but we yet have to assign a value to it. So in the next step as you can see a = 7 now var a has a value inside which is number 7.

If we look at var b we have only declare the variable name but never assigned any value to it. So at this stage we have total of two variables var a which has value 7 and var b which is without any value.

In the task they said * Assign the contents of a to variable b .* which simpily means just make the variable of b to same as a. So what we could do here? here is the hint -----> = this EQUAL sign can will help you out.

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