Files
liquid/_filters/first.md
2019-07-28 16:27:13 -04:00

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 }}