@johnny.reina/chaos-sort
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Chaos Sort @johnny.reina/chaos-sort

Scrambles an array until it is sorted, then returns it

Time Complexity

The sky's the limit.

Installation

npm i @johnny.reina/chaos-sort

Usage

import { chaosSort } from "@johnny.reina/chaos-sort";
const input = [
  { name: "Sam", age: 22 },
  { name: "Ed", age: 53 },
  { name: "Sally", age: 49 },
];
const actual = chaosSort(input, (x) => x.age);
// [
//   { name: "Sam", age: 22 },
//   { name: "Sally", age: 49 },
//   { name: "Ed", age: 53 },
// ]

Ord?

Ord as a convention is used to mean anything that can be ordered. In this case, strings, numbers, booleans, and Date objects can be ordered natiively in JavaScript.

Dependents (0)

Package Sidebar

Install

npm i @johnny.reina/chaos-sort

Weekly Downloads

3

Version

0.2.0

License

MIT

Unpacked Size

4.85 kB

Total Files

6

Last publish

Collaborators

  • johnny.reina