--- url: https://developer.youcan.shop/themes/filters/arrays/last.md --- # Last Returns the last item of an array. You can also use `last` with dot notation, also in the middle of a path. ## Example ::: details Data ```json { "products": [ { "title": "Hat", "price": 10 }, { "title": "Tee", "price": 25.5 }, { "title": "Cap", "price": 8 } ] } ``` ::: ```liquid {% assign product = products | last %} {{ product.title }} {{ products.last.title }} ``` ::: tip Output ```html Cap Cap ``` :::