--- url: https://developer.youcan.shop/themes/filters/arrays/sort.md --- # Sort Sorts the items of an array. With a property name, the filter sorts the items by the value of this property. The sort is case-sensitive: uppercase letters come before lowercase letters. ```liquid {{ array | sort: property }} ``` ## Example ::: details Data ```json { "colors": [ "red", "Blue", "green" ], "products": [ { "title": "Hat", "price": 10 }, { "title": "Tee", "price": 25.5 }, { "title": "Cap", "price": 8 } ] } ``` ::: ```liquid {{ colors | sort | join: ', ' }} {%- assign sorted = products | sort: 'price' %} {{ sorted | map: 'title' | join: ', ' }} ``` ::: tip Output ```html Blue, green, red Cap, Hat, Tee ``` :::