Assigning var a to var b

Assigning var a to var b
0

#1

Tell us what’s happening:

I am trying to assign a to b but nothing seems to be happening. Have I done this incorrectly?

Your code so far


// Setup
var a;
var b = 2;

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

Your browser information:

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

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


#2

You redeclare var a and b triple times


#3

I have changed it to this:

// Setup
var a;
var b = 2;

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

Still the same issue.

Task:
a should be assigned to b with =
a should have the value of 7
b should have the value of 7


#4

The declarations mean you say to comp: hey this text ‘a’ is var, one time and than the comp know that a is variable not a text.
https://www.w3schools.com/js/js_variables.asp


#5

Thanks for the clarification it worked :grinning:


#6

I like I help, and click on solution [] on my answer