+=
运算符一样, -=
从变量中减去一个数字。 myVar = myVar - 5;
将从myVar
减去5
。这可以改写为: myVar -= 5;
a
, b
和c
的赋值以使用-=
运算符。 a
应该等于5
testString: assert(a === 5);
- text: b
应该等于-6
testString: assert(b === -6);
- text: c
应该等于2
testString: assert(c === 2);
- text: 您应该为每个变量使用-=
运算符
testString: assert(code.match(/-=/g).length === 3);
- text: 不要修改行上方的代码
testString: assert(/var a = 11;/.test(code) && /var b = 9;/.test(code) && /var c = 3;/.test(code));
```