---
title: "Flagged enum, why and how"
url: https://daily.dev/posts/flagged-enum-why-and-how-vqlhgdks0
source_url: https://timdeschryver.dev/blog/flagged-enum-what-why-and-how
type: article
source: "Tim Deschryver"
author: "Tim Deschryver"
published: 2026-05-31T07:47:22.885Z
updated: 2026-06-01T04:00:55.971Z
tags: ["typescript", "angular"]
reading_time: 3
upvotes: 0
comments: 0
language: 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.

# Flagged enum, why and how

**[Tim Deschryver](https://daily.dev/sources/timdeschryver)** · [@timdeschryver](https://daily.dev/timdeschryver) · 3 min read · 0 upvotes · 0 comments

## Summary

Flagged enums offer an efficient way to store and transmit collections of boolean values as a single numeric value using bit flags. Each enum value is assigned a power-of-two bit value, making every combination unique. Using bitwise operators, you can convert a user's multi-select (e.g., weekday checkboxes) into a single integer and back, reducing verbosity compared to arrays or separate database tables. An Angular reactive forms example is included to demonstrate the pattern in practice.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://timdeschryver.dev/blog/flagged-enum-what-why-and-how>

## Similar posts on daily.dev

- [C\# Enum Flags: Combining Values with Bitwise Operations](https://daily.dev/posts/c-enum-flags-combining-values-with-bitwise-operations-dzb7h7dhx) · We Are .NET · 2 upvotes · 0 comments
- [Vercel Flags now supports JSON values](https://daily.dev/posts/vercel-flags-now-supports-json-values-yptedehml) · Vercel · 1 upvotes · 0 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#angular](https://daily.dev/tags/angular)

[View this post on daily.dev](https://daily.dev/posts/flagged-enum-why-and-how-vqlhgdks0)
