Storing Values with the Assignment Operator
See original GitHub issueChallenge Name
Storing Values with the Assignment Operator
Issue Description
Do not change code above the line a should have a value of 7 b should have a value of 7 a should be assigned to b with =
Browser Information
In JavaScript, you can store a value in a variable with the assignment operator.
myVariable = 5;
Assigns the Number value 5 to myVariable.
Assignment always goes from right to left. Everything to the right of the = operator is resolved before the value is assigned to the variable to the left of the operator.
myVar = 5; myNum = myVar; Assigns 5 to myVar and then resolves myVar to 5 again and assigns it to myNum.
Instructions Assign the value 7 to variable a.
Assign the contents of a to variable b.
- Browser Name, Version:
- Operating System:
- Mobile, Desktop, or Tablet:
Your Code
// Setup
var a;
var b = 2;
// Only change code below this line
Screenshot

Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Storing Values with the Assignment Operator - JavaScript
Assignment always goes from right to left. Everything to the right of the = operator is resolved before the value is assigned to...
Read more >Storing Values with the Assignment Operator | Basic JavaScript
In JavaScript, you can store a value in a variable with the assignment operator ( = ). myVariable = 5;. This assigns the...
Read more >Storing Values With The Assignment Operator
In JavaScript, you can store a value in a variable with the assignment operator. myVariable = 5;. Assigns the Number value 5 to...
Read more >Assignment Operators - Manual - PHP
Note that the assignment copies the original variable to the new one (assignment by value), so changes to one will not affect the...
Read more >Assignment (=) - JavaScript - MDN Web Docs - Mozilla
The assignment (=) operator is used to assign a value to a variable. The assignment operation evaluates to the assigned value. Chaining the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@sanjayk722 Please read the question carefully and code accordingly.The question is correct.
@sanjayk722 some challenges are tricky, and are set up to make think harder, always reread the introduction, instructions, comments, and ask for help and a second opinion in the freecodecamp chatrooms!
This challenge works, although i can understand the confusion…
Also returning the answer does not pass the challenge, because it is not specific to the instructions
for example