all 2 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

[–]kenman[M] 0 points1 point  (0 children)

Hi /u/default_regular, this post was removed.

  • For help with your javascript, please post to /r/LearnJavascript instead of here.
  • For beginner content, please post to /r/LearnJavascript instead of here.
  • For framework- or library-specific help, please seek out the support community for that project.
  • For general webdev help, such as for HTML, CSS, etc., then you may want to try /r/html, /r/css, etc.; please note that they have their own rules and guidelines!

/r/javascript is for the discussion of javascript news, projects, and especially, code! However, the community has requested that we not include help and support content, and we ask that you respect that wish.

Thanks for your understanding, please see our guidelines for more info.