Storing Values with the Assignment Operator// Help

Tell us what’s happening:
I’ve done everything else I was supposed to do as far as assigning the variables correctly. But I am still stuck on the last assignment. Assigning a to b with = . Ive tried doing this so many times but I can’t seem to get it right. Can I get some help please. Its my first time on Java.

Your code so far


// Setup
var a;
var b = 2;

var a = 7;
var b = 7;
var a = b;

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.

Link to the challenge:

A couple things:

  1. You only want to use var when you are creating a new variable. Using var repeatedly for the same variable can cause errors.
  2. Your last line assigns b to a rather than assigning a to b.

An extra thing, this is not Java, but JavaScript, they are completely different things

thanks for the correction lol. I wouldn’t have known that.

ohhhh that does make sense thanks.