[SOLVED] Compound Assignment With Augmented Addition 2017

[SOLVED] Compound Assignment With Augmented Addition 2017
0

#1

Tell us what’s happening:

Instructions
Convert the assignments for a, b, and c to use the += operator.
I have written the code, as it’s told to do, but I receive this message
"You should use the += operator for each variable"

Your code so far

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

// Only modify code below this line

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

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

Your browser information:

Your Browser User Agent is: Google Chrome (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36```.

Link to the challenge:


#2

Declaring a variable with compound assignment is not allowed (as in var a += 12), because compound assignment needs an existing value for that variable. In this case the variable a is newly created, so it has no sensible value yet.

The idea for this challenge is to modify the additions such that they use compound assignment. Reset your code and try again.


#3

Thank you, it worked