Storing Values with the Assignment Operator?

Tell us what’s happening:

// Setup

var a; 7

var b = a;

// Only change code below this line

a = 7;

b = a;

What is wrong?

Your code so far


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

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

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator/

Hi,

You are not passing the task Do not change code above the line.

As far as I can see, once you initialized the a variable you had also specified the 7 after the semicolon.

var a; 7

It is unnecessary. So you can just remove that 7. This should help you to pass all the tasks.

1 Like