Initializing Variables with the Assignment Operator

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

// Setup
var b;
var  = 7; // The variable 'a' is equal to b
var a;
var b = b; // The variable 'b' is equal to 7

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Assigning the Value of One Variable to Another

Hello. You seem to have made some changes to the code above the line labelled “Only change code below this line”. Please kindly hit the button that says “Reset this lesson”.

From there, type below the line and use the assignment operator to assign the value of a to b.

And here is a fine example of using the assignment operator.

var test; 
test = 5; 

In this example I use the assignment operator to assign the value of test to 5.

If you need any further help, let me know.

Happy learning. :slight_smile:

1 Like

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