init
function, since version 1.0.0
categories: arrays
init(arr, [n=1])
returns input array without the last n
elements. Parameter n
is optional, with default value 1
parameters
- arr: array[any] - array of any items
- n: number - number of items to remove from the end [optional parameter]
return type:
any
example
init(split('a:b:c:d:e', ':'))
init(split('a:b:c:d:e', ':'), 2)
init(tail(split('a:b:c:d:e', ':'), 2), ':')
returns
[a, b, c, d]
[a, c, d]
a:b:c