*=
运算符将变量乘以数字。 myVar = myVar * 5;
将myVar
乘以5
。这可以改写为: myVar *= 5;
a
, b
和c
的赋值以使用*=
运算符。 a
应该等于25
testString: 'assert(a === 25, "a
should equal 25
");'
- text: b
应该等于36
testString: 'assert(b === 36, "b
should equal 36
");'
- text: c
应该等于46
testString: 'assert(c === 46, "c
should equal 46
");'
- text: 您应该为每个变量使用*=
运算符
testString: 'assert(code.match(/\*=/g).length === 3, "You should use the *=
operator for each variable");'
- text: 不要修改行上方的代码
testString: 'assert(/var a = 5;/.test(code) && /var b = 12;/.test(code) && /var c = 4\.6;/.test(code), "Do not modify the code above the line");'
```