Logo

Programming-Idioms

History of Idiom 28 > diff from v63 to v64

Edit summary for version 64 by agile:
New Scala implementation by user [agile]

Version 63

2020-10-13, 15:24:50

Version 64

2021-02-26, 20:09:50

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.

Variables
items,x,p
Variables
items,x,p
Code
items.sortBy(_.x)