Skip to content

#skipWhile

Returns the array without the leading elements that satisfy a condition.

#skipWhile(array, @x: predicate)
Category Arrays and sequencesValid in Property value
Name Type Description
array path | array The source array.
predicate lambda Returns true to keep skipping.

array

source.json
{
"numbers": [ 1, 2, 6, 3 ]
}
transformer.json
{
"result": "#skipWhile($.numbers, @x: @x < 5)"
}
output.json
{
"result": [ 6, 3 ]
}

Try it in the playground →

#takeWhile · #skip