--- title: "Liquid filters: reverse" description: Reverses the order of the items in an array. api_name: liquid source_url: html: https://shopify.dev/docs/api/liquid/filters/reverse md: https://shopify.dev/docs/api/liquid/filters/reverse.md --- # reverse ```oobleck array | reverse ``` Reverses the order of the items in an array. ```liquid Original order: {{ collection.products | map: 'title' | join: ', ' }} Reverse order: {{ collection.products | reverse | map: 'title' | join: ', ' }} ``` ## Output ```html Original order: Draught of Immortality, Glacier ice, Health potion, Invisibility potion Reverse order: Invisibility potion, Health potion, Glacier ice, Draught of Immortality ``` ### Reversing strings You can't use the `reverse` filter on strings directly. However, you can use the [`split` filter](https://shopify.dev/docs/api/liquid/filters/split) to create an array of characters in the string, reverse that array, and then use the [`join` filter](https://shopify.dev/docs/api/liquid/filters/join) to combine them again. ```liquid {{ collection.title | split: '' | reverse | join: '' }} ``` ## Output ```html snoitop elaS ```