It won't work so please help

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:

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 :slight_smile: 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!!! :slight_smile: