Tell us what’s happening:
My code won’t work.
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 (Linux; Android 7.1.2; KFKAWI) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.96 Safari/537.36
.
Challenge: Storing Values with the Assignment Operator
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
Welcome liamedwardh.
I believe you need a var
before you try to reassign var a
.
For example, `var a = b;
Try that and see if that helps.
Hello there @liamedwardh ,
Let’s look at back at the instructions:
It asks you to assign 7 to variable a. That means you want to give a
a value of 7. Here’s an example: var randomNum = 15
.
Then it asks you to assign the contents of a
to variable b
. In your code, you’re trying to assign b
to a
, So you can fix it just by flipping the assignment around.
Hope this helps Happy Coding!!
1 Like
Don’t answer because I found the answer.
1 Like
Great Job finding the answer!!! Now you can go on and continue on your coding journey into JavaScript. Good Luck and Happy Coding!!!