Storing Values with the Assignment Operator how to do this i tried all

Storing Values with the Assignment Operator how to do this i tried all
0.0 0

#1

Tell us what’s happening:

Your code so far


// Setup
var a;
var b = 2;

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

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 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

variable a is already defined. To assign a value just write without the var keyword; just like this:

a=7;
b=a;


#3

is it not possible a = b because I did this but got eRRoR


#4

You are not asked to assign a to b not 7 to b or b to a. That’s what you did. And as @Lahsini said the two variables are already declared using var. Don’t need to declare again.


#5

ok dude copied that; thanks