const rest = 17 % 5;
console.log(rest);The expression produces 2, which is stored in the rest constant.
LESSON 11 OF 50
Use the % operator to obtain the remainder of a division.
The % operator returns the remainder after dividing the first number by the second. For 17 and 5, the integer quotient is 3 and the remainder is 2.
const rest = 17 % 5;
console.log(rest);The expression produces 2, which is stored in the rest constant.
const rest = 17 / 5;
console.log(rest);The / operator calculates the quotient 3.4, not the remainder.
Declare rest as 17 % 5 and print the variable.
Run the code to see the result.The operator is applied to the required values, and the output confirms the real result.
ANALYSIS REQUEST
The initial discussion is without obligation. You receive an honest recommendation, suitable stages and the factors that affect price.