Logo

Programming-Idioms

History of Idiom 28 > diff from v84 to v85

Edit summary for version 85 by www:
[Dart] dd

Version 84

2022-02-05, 00:04:22

Version 85

2022-06-21, 17:16:37

Idiom #28 Sort by a property

Sort the elements of the list (or 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 the elements of the list (or 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.sort((a, b) => (a.p).compareTo(b.p));
Code
items.sort((a, b) => (a.p).compareTo(b.p));