2026 Community Survey results are here! See how the Craft CMS community works. results are live!

What is a ternary operator?

The three-part ternary operator helps us write compact conditionals. Is it easier or harder to read than a standard conditional expression? Let's learn the basics about it.

Transcript

Premium

Follow along with the full transcript

Search every word, click any line to jump to that moment, and read along as you watch — a CraftQuest Premium feature.

Sign up for Premium
Instructor
Date Published
June 26, 2018

Some stuff to help you along during the lesson: