Files
liquid/filters/first.md
2016-11-08 16:23:33 -05: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 }}