Basic JavaScript - Assigning the Value of One Variable to Another

**So I cant do what the prompt says. **
The prompt tells me to assign the contents of A to variable B. If you look at my code I did "var a = b; " and it still doesn’t work, any suggestions?

Your code so far

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

// Only change code below this line
var myVar;
myVar = a;
var myNum;
myNum = myVar;
var a = b;
var b = 7;

Your browser information:

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

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

Link to the challenge:

you already declare the variable “a” and give it a value then you declare the variable “b” and you want to give it the a’s value so you could just write [solution redacted] without var cause both already declared

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