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 Parameter | Type | Description |
---|---|---|
array | Array | The array to reverse |
Return value
Type |
---|
Array<any> |
Sample
Example | Result | Description |
---|---|---|
reverse([1,2,3]) | [3,2,1] | Returns an array |
To view all the List functions, click here.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article