In this blog post, we're going to learn how the Modulo operator works by refining our mental model for division. In situations where the dividend (the number to be divided) can't be split equally into groups, the modulo operator lets us know how much is left over. In the example widget above, our dividend is 12.

4m read timeFrom joshwcomeau.com
Post cover image
Table of contents
Link to this heading Rethinking divisionLink to this heading A real-world use case

Sort: