W3cubDocs

/Liquid

last

Returns the last item of an array.

Input

{% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}

{{ my_array.last }}

Output

plums

Input

{% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %}

{{ my_array.last }}

Output

tiger

© 2005, 2006 Tobias Luetke
Licensed under the MIT License.
https://shopify.github.io/liquid/filters/last/