reverse

Modified on Fri, 18 Aug 2023

Description

Reverse `array` so that the first element becomes the last, the second element becomes the second to last, and so on.

Syntax

reverse(array)

Parameters

Input ParameterTypeDescription
arrayArrayThe array to reverse

Return value

Type
Array<any>

Sample

ExampleResultDescription
reverse([1,2,3])[3,2,1]Returns an array

To view all the List functions, click here.