Modifier: flip

Swaps the keys with their corresponding values. The old switcharoo.

favorites:
  chicken: nuggets
  nuggets: Denver
{{ favorites }}
  My favorite {{ key }} is {{ value }}.
{{ /favorites }}

{{ favorites | flip }}
  My favorite {{ key }} is {{ value }}.
{{ /favorites }}
My favorite chicken is nuggets.
My favorite nuggets is Denver

My favorite nuggets is chicken
My favorite Denver is nuggets.

It’s a weird example with bad grammer. Hopefully you’re okay with it.

Betterify this page on Github!