Skip to main content

last

array | last

Returns the last item in an array.

{%- assign last_product = collection.products | last -%}

{{ last_product.title }}

Output

Whole bloodroot

You can use the last filter with dot notation when you need to use it inside a tag or object output.

{{ collection.products.last.title }}

Output

Whole bloodroot
Was this page helpful?