Knap.md
LogicFiltersVariablesAPIGitHub ↗

Guide

VariablesLogicFilters

Reference

API

Project

GitHub ↗npm ↗

last

Return the last item in an array.

Filters/last

Syntax

{{ value | last }}

Example

01

Basic usage

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

Related filters

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

On this page

SyntaxExamplesRelated filters
last filter — Knap