Skip to main content

--description--

Like the += operator, -= subtracts a number from a variable.

myVar = myVar - 5;

will subtract 5 from myVar. This can be rewritten as:

myVar -= 5;

--instructions--

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

--hints--

a should equal 5.

assert(a === 5);

b should equal -6.

assert(b === -6);

c should equal 2.

assert(c === 2);

You should use the -= operator for each variable.

assert(__helpers.removeJSComments(code).match(/-=/g).length === 3);

You should not modify the code above the specified comment.

assert(
/let a = 11;/.test(__helpers.removeJSComments(code)) && /let b = 9;/.test(__helpers.removeJSComments(code)) && /let c = 3;/.test(__helpers.removeJSComments(code))
);

--seed--

--after-user-code--

(function(a,b,c){ return "a = " + a + ", b = " + b + ", c = " + c; })(a,b,c);

--seed-contents--

let a = 11;
let b = 9;
let c = 3;

// Only change code below this line
a = a - 6;
b = b - 15;
c = c - 1;

--solutions--

let a = 11;
let b = 9;
let c = 3;

a -= 6;
b -= 15;
c -= 1;