Basic JavaScript - Assigning the Value of One Variable to Another

I’m a beginner, can somebody please help me solve this

// 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/110.0.0.0 Safari/537.36 Edg/110.0.1587.50

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

Link to the challenge:

This code declares a variable named a with the var keyword.
The variable now exists but is undefined.
It is then given a value of 7.
A second variable (b) is declared (again undefined).
Your task is to assign the value of variable a to variable b.
You can do this by assigning a directly to b using =.

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