mirror of
https://github.com/kemko/liquid.git
synced 2026-01-05 09:45:40 +03:00
732 B
732 B
title, description
| title | description |
|---|---|
| first | Liquid filter that returns the first item of an array. |
Returns the first item of an array.
Input
```liquid {% raw %} {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}{{ my_array.first }} {% endraw %}
<p class="code-label">Output</p>
```text
{% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array.first }}
Input
```liquid {% raw %} {% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %}{{ my_array.first }} {% endraw %}
<p class="code-label">Output</p>
```text
{% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %}
{{ my_array.first }}