%
дает остаток от деления двух чисел. пример 5% 2 = 1, потому чтоПрименение
Math.floor (5/2) = 2 (Quotient)
2 * 2 = 4
5 - 4 = 1 (Остаток)
2
. 17% 2 = 1 (17 - нечетное)Заметка
48% 2 = 0 (48 равно)
remainder
равный остальной части 11
деленной на 3
используя оператор остатка ( %
).
remainder
should be initialized
testString: assert(/var\s+?remainder/.test(code));
- text: The value of remainder
should be 2
testString: assert(remainder === 2);
- text: You should use the %
operator
testString: assert(/\s+?remainder\s*?=\s*?.*%.*;/.test(code));
```