Skip to content

#reverse

Returns the string or array with its elements in reverse order.

#reverse(value)
Category Strings and arraysValid in Property value
Name Type Description
value path | string | array The string or array to reverse.

string | array

source.json
{
"text": "abc",
"items": [ 1, 2, 3 ]
}
transformer.json
{
"text": "#reverse($.text)",
"items": "#reverse($.items)"
}
output.json
{
"text": "cba",
"items": [ 3, 2, 1 ]
}

Try it in the playground →