Skip to content

reverse

Signature

reverse(array|string)

Description

Reverses the input string or array and returns the result.

Examples

reverse('abcd') == 'dcba'
reverse([`1`, `2`, `3`, `4`]) == [`4`, `3`, `2`, `1`]