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 myVar;
// This establishes the variable myVar with no definition
myVar = 7;
// This line makes 7 the definition for myVar
var b = myVar;
// This line makes var b equal to 7 because 7 is equal to myVar

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

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

Link to the challenge:

Your code is not what was requested.
The original code given was very simple.

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

// Only change code below this line

and you were asked to assign the variable b to the variable a.
This means you need exactly one line of code with exactly 3 characters in it (not counting a semicolon).

Please try again.

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