Skip to content

Commit 37f8832

Browse files
jswannerjosevalim
authored andcommitted
Fix Enum cheatsheet for drop/2 and take/2 with negative index (#13080)
1 parent 7ebf5c3 commit 37f8832

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/elixir/pages/cheatsheets/enum-cheat.cheatmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,10 @@ Negative indexes count from the back:
820820

821821
```elixir
822822
iex> Enum.drop(cart, -1)
823-
[%{fruit: "orange", count: 6}]
823+
[
824+
%{fruit: "apple", count: 3},
825+
%{fruit: "banana", count: 1}
826+
]
824827
```
825828

826829
### [`drop_every(enum, nth)`](`Enum.drop_every/2`)
@@ -851,10 +854,7 @@ Negative indexes count from the back:
851854

852855
```elixir
853856
iex> Enum.take(cart, -1)
854-
[
855-
%{fruit: "apple", count: 3},
856-
%{fruit: "banana", count: 1}
857-
]
857+
[%{fruit: "orange", count: 6}]
858858
```
859859

860860
### [`take_every(enum, nth)`](`Enum.take_every/2`)

0 commit comments

Comments
 (0)