Compound Assignment With Augmented Addition += operator not working

Compound Assignment With Augmented Addition += operator not working
0

#1

Tell us what’s happening:
I’m pretty sure that my code is correct but I am getting an error message saying I need to “You should use the += operator for each variable”

Your code so far

var a = 3;
var b = 17;
var c = 12;


var a += 12;
var b += 9;
var c += 7;

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36.

Link to the challenge:


#2

You can’t use += together with the var keyword. When you use +=, it is assumed that the variable you’re using it on is already declared, so there shouldn’t be vars there.


#3

Oh, thanks a lot! I was getting really frustrated because I couldn’t understand why I was getting an error message!