You need to enable JavaScript to run this website.
Sorting observable arrays
An ordered array of numbers:
Inserting new element
simpleArrayA.push()
Replacing all elements
Switching between different sorting functions
switches between ways of sorting:
- (x,y)=>x.v-y.v (according to values) and
- (x,y)=>x.v*x.v-y.v*y.v (according to absolute values)
Dynamically changing sorting functions
availableDNs=new DB.observable([selectedSorting],{type:'oarray',value:[],sort:()=>sorters[selectedSorting()]})
←(dynamic) sort – is similar to compute; it is a function (with no arguments) returning the sorting function.
A real-life example
See leanws.com/domains:
Sort domain zones by