← DevOps Foundations
8 / 25
Lesson 8 — Feature flags
Turn features on without a deploy
A feature flag is a setting that switches a feature on or off while the app is running. You ship new code "dark" (flag off), then turn it on for some users, and switch it off instantly if something goes wrong — no new deploy needed. Flags can target groups, like only beta testers.
flags.darkMode && user.admin ? "dark" : "light"
Why it matters: flags separate "code is deployed" from "users see it", which makes releases far less scary.
Want it another way?
Task
Show the new UI only when flags.newUI is on AND the user is a beta tester.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
Test your knowledge
A quick 3-question quiz on this lesson — instant feedback.