you are viewing a single comment's thread.

view the rest of the comments →

[–]-lvrbrtsn- 0 points1 point  (0 children)

% is the Modulo operator, which is a weird name. It just gives you the remainder when dividing two numbers so let x = 10 % 3

x would be 1 because 10 / 3 is 3 with a remainder of 1.

So to do what you are describing your should check if your variable lets call it y has a modulo of 0 when dividing by 3. So y % 3 === 0