Knap.md
LogicFiltersVariablesAPIGitHub ↗

Guide

VariablesLogicFilters

Reference

API

Project

GitHub ↗npm ↗

first

Return the first item in an array.

Filters/first

Syntax

{{ value | first }}

Example

01

Basic usage

InputTS
1{2  "items": [3    "a",4    "b",5    "c"6  ]7}
TemplateKNAP
1{{ items | first }}
OutputKNAP
1a

Related filters

lastReturn the last item in an array.sliceExtract part of a string or array.
Previous← roundNextjoin →
Knap is open source under the MIT license.View source ↗

On this page

SyntaxExamplesRelated filters
first filter — Knap