Programming-Idioms

History of Idiom 28 > diff from v51 to v52

Edit summary for version 52 :
[Elixir] Dead link: play.elixirbyexample.com has been down for a while

Version 51

Version 52

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of the type Item of the objects in items.

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of the type Item of the objects in items.

Code
Enum.sort_by(items, &(&1.p))
Code
Enum.sort_by(items, &(&1.p))
Doc URL
https://hexdocs.pm/elixir/Enum.html#sort_by/3
Doc URL
https://hexdocs.pm/elixir/Enum.html#sort_by/3
Demo URL
http://play.elixirbyexample.com/s/9ab4ff24fb