<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/understanding-the-javascript-modulo-operator-gjj1wxe6f" -->

---
title: Understanding the JavaScript Modulo Operator | daily.dev
description: 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...
canonical: https://daily.dev/posts/understanding-the-javascript-modulo-operator-gjj1wxe6f
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Understanding the JavaScript Modulo Operator | daily.dev
og:description: 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...
og:url: https://daily.dev/posts/understanding-the-javascript-modulo-operator-gjj1wxe6f
og:image: https://api.daily.dev/og/posts/gjj1wXE6f.png
og:image:alt: Understanding the JavaScript Modulo Operator
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding the JavaScript Modulo Operator

**[Josh W Comeau](https://daily.dev/sources/joshwcomeau)** · 4 min read · 13 upvotes · 0 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.joshwcomeau.com/javascript/modulo-operator/>

---

Tags: [#react](https://daily.dev/tags/react), [#course](https://daily.dev/tags/course)

[View this post on daily.dev](https://daily.dev/posts/understanding-the-javascript-modulo-operator-gjj1wxe6f)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Understanding the JavaScript Modulo Operator","url":"https://daily.dev/posts/understanding-the-javascript-modulo-operator-gjj1wxe6f","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/understanding-the-javascript-modulo-operator-gjj1wxe6f"},"datePublished":"2023-09-18T14:40:49.513Z","dateModified":"2023-09-18T14:40:47.307Z","description":"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...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a6ec479e3f23997f1a16de7b1dfbd490?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a6ec479e3f23997f1a16de7b1dfbd490?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Josh W Comeau","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Josh W Comeau","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/4a121572d03c40a2bff9e8ed0f0792b5","url":"https://daily.dev/sources/joshwcomeau"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/understanding-the-javascript-modulo-operator-gjj1wxe6f","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"react,course","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Josh W Comeau","item":"https://daily.dev/sources/joshwcomeau"},{"@type":"ListItem","position":3,"name":"Understanding the JavaScript Modulo Operator"}]}
```

