Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 776 Bytes

array.md

File metadata and controls

37 lines (23 loc) · 776 Bytes
permalink
/array/

array

local array = import "github.com/jsonnet-libs/xtd/array.libsonnet"

array implements helper functions for processing arrays.

Index

Fields

fn filterMapWithIndex

filterMapWithIndex(filter_func, map_func, arr)

filterMapWithIndex works the same as std.filterMap with the addition that the index is passed to the functions.

filter_func and map_func function signature: function(index, array_item)

fn slice

slice(indexable, index, end='null', step=1)

slice works the same as std.slice but with support for negative index/end.