Basic JavaScript - Compound Assignment With Augmented Addition

Hey am 15 years old and am trying to get into coding maybe do this as my work when i get older but am stuck on this problems can i get help please.

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

// Only change code below this line
a = a + 11;
b = b + 9;
c = c + 7;

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Compound Assignment With Augmented Addition

Link to the challenge:

You need to change the last three lines to use the += operator instead of the + operator. Don’t change the numbers in those lines.

Look at the example in the instructions:

myVar += 5;

This is the same thing as:

myVar = myVar + 5;

So you need to convert the last three lines in the challenge from the longer form which uses just the + operator to the shorter form that uses the += operator.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.