Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions content/collections/pages/antlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,14 @@ The null coalescing operator (`$a ?? $b`) considers each variable in a statement
{{ meta_title ?? title ?? "Someone Forgot the Title" }}
```

:::tip
Use `???` to fall through only on `null`. Keeps `0`, `false`, `''` intact.

```antlers
{{ power_level ??? "It's over 9000!" }}
```
:::

### The Gatekeeper (Truthy assignment) {#gatekeeper}

The Gatekeeper operator (`a ?= b`) will execute an expression **if and only if** it passes a "truthy" check. It doesn't exist in any programming language — we invented this one. Enjoy!
Expand Down