Skip to content

ShittyLabs/chaos-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chaos Sort @johnny.reina/chaos-sort

Scrambles an array until it is sorted, then returns it

Why?

caption: yeah. a scrampble function is a sort function if you run it enough times. oh my god. i have an idea.

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.

About

Scrambles an array until it is sorted

Resources

License

Stars

Watchers

Forks

Packages

No packages published