Skip to content

Commit

Permalink
doc(readme): add comment for lo.Reverse mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Dec 21, 2022
1 parent a780656 commit 07f7c79
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ randomOrder := lo.Shuffle[int]([]int{0, 1, 2, 3, 4, 5})

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

⚠️ This helper is **mutable**. This behavior might change in `v2.0.0`. See [#160](https://github.com/samber/lo/issues/160).

```go
reverseOrder := lo.Reverse[int]([]int{0, 1, 2, 3, 4, 5})
// []int{5, 4, 3, 2, 1, 0}
Expand Down

0 comments on commit 07f7c79

Please sign in to comment.