rocinantealpha

reference / lists

sort

A list in order of what the block gives for each item: sort particles by [ it.size ].

people = [ { name: "cy", age: 30 } { name: "ada", age: 12 } ]by_age = sort people by [ it.age ]for each p in by_age [ print p.name ]

It prints

ada
cy

How to write it

sort list by [ expression ]

Gives a list.

Related