reverse
ArrayReverses the order of an array without sorting. Useful after a sort to flip direction, or to reverse an already-ordered API response.
Syntax
reverseUse cases
| Use case | Description | URL | |
|---|---|---|---|
| Sort then flip | Sort ascending then reverse to get a descending list — alternative to rsort. | https://httpip.es/api/pipe/echo:[3,1,4,1,5,9,2,6]|sort|reverse | |
| Reverse paginated API results | When an API returns oldest-first, reverse it to get the newest 5 at the top. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/posts|tail:10|reverse|pick:id,title | |
| Reverse a repo list | Flip the default alphabetical order of a user's repos. | https://httpip.es/api/pipe/fetch:https://api.github.com/users/octocat/repos|sort:name|reverse|pluck:name | |
| Read-last-first | Reverse a comment thread to show the most recent reply at the top. | https://httpip.es/api/pipe/fetch:https://jsonplaceholder.typicode.com/comments|filter:postId,eq,1|reverse |