Compound Assignment With Augmented Addition

Compound Assignment With Augmented Addition
0

#1

hello, can somebody please help me with this.
i dont really now what im doing wrong on b)

Convert the assignments for a, b, and c to use the += operator.

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

// Only modify code below this line

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


#2

So, they are looking for the short-hand version of the following:

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

Using the first line as an example, the += operator takes the place of the following:

a = a +

Basically, you don’t need both = signs in your solution. You need to only use the += operator.


#3

This works for me:

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

// Only modify code below this line

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