Skip to content

Latest commit

 

History

History
7 lines (6 loc) · 203 Bytes

function.HH.Lib.Dict.group_by.md

File metadata and controls

7 lines (6 loc) · 203 Bytes

Group numbers by their parity (separate even and odd numbers):

$numbers = vec[1, 1, 2, 3, 5, 8, 14];
$groups = Dict\group_by($numbers, $value ==> $value % 2);
\print_r($groups);