@extra-array/sort-on.min
TypeScript icon, indicating that this package has built-in type declarations

2.7.8 • Public • Published

Arranges values in an order. 🏃 📼 📦 🌔

Alternatives: compare, compare-update, map, map-update.
This is part of package extra-array.

This is browserified, minified version of @extra-array/sort-on.
It is exported as global variable array_sortOn.
CDN: unpkg, jsDelivr.

array.sortOn(x, [fn], [ths]);
// x:   an array
// fn:  map function (v, i, x)
// ths: this argument
const array = require('extra-array');

var x = [-3, -2, 1, 4];
array.sortOn(x, v => Math.abs(v));
// [ 1, -2, -3, 4 ]

var x = ['B', 'D', 'a', 'c'];
array.sortOn(x, v => v.toLowerCase());
// [ 'a', 'B', 'c', 'D' ]

references

Package Sidebar

Install

npm i @extra-array/sort-on.min

Weekly Downloads

0

Version

2.7.8

License

MIT

Unpacked Size

9.93 kB

Total Files

24

Last publish

Collaborators

  • wolfram77