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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15

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

Link to the challenge:

You don’t want to declare b again by using var. You declared it above and that is all you need. You can’t declare a variable on the right side of an equals sign like that. You reference the value in a by just using the variable name a.

1 Like

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