%给出了两个数的除法的余数。 例 5%2 = 1因为用法
Math.floor(5/2)= 2(商数)
2 * 2 = 4
5 - 4 = 1(剩余)
2的余数,可以检查数字是偶数还是奇数。 17%2 = 1(17为奇数)注意
48%2 = 0(48为偶数)
% )运算符将remainder设置为等于11的余数除以3 。 remainder
testString: 'assert(/var\s+?remainder/.test(code), "The variable remainder should be initialized");'
- text: remainder的值应为2
testString: 'assert(remainder === 2, "The value of remainder should be 2");'
- text: 您应该使用%运算符
testString: 'assert(/\s+?remainder\s*?=\s*?.*%.*;/.test(code), "You should use the % operator");'
```