Skip to content

Commit 7328c6b

Browse files
authored
Update mapSpread Callback Parameters
The mapSpread parameters takes the first value and then the second value, which is the even number 0, 2, 4, etc and the corresponding odd number 1, 3, 5, etc. This change corrects the parameters to correctly match to eliminate any possible confusion.
1 parent 4c179ee commit 7328c6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

collections.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,8 @@ The `mapSpread` method iterates over the collection's items, passing each nested
10261026

10271027
$chunks = $collection->chunk(2);
10281028

1029-
$sequence = $chunks->mapSpread(function ($odd, $even) {
1030-
return $odd + $even;
1029+
$sequence = $chunks->mapSpread(function ($even, $odd) {
1030+
return $even + $odd;
10311031
});
10321032

10331033
$sequence->all();

0 commit comments

Comments
 (0)