Logo

Programming-Idioms

History of Idiom 28 > diff from v51 to v52

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

Version 51

2019-09-27, 09:52:52

Version 52

2019-10-14, 12:23:42

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