A JavaScript module to maintain a sorted, private array.
npm install @afoot/sorted-arrayA configurable JavaScript module to maintain a sorted, private array.
_Sorted Array_ can be used as an npm package or download the package and use it as an ESM module right in the browser.
View full documentation and examples at https://niftinessafoot.github.io/sorted-array/
_Sorted Array_ takes either an array of existing data or a config object.
``js
import { SortedArray } from '@afoot/sorted-array/';
const sortedArray = new SortedArray([5, 2, 3]);
sortedArray.log; // returns [2,3,5]
`
You can add, edit, and delete from the instance.
`js
import { SortedArray } from '@afoot/sorted-array/';
const sortedArray = new SortedArray([5, 2, 3]);
sortedArray.add('1');
sortedArray.log; // returns [1,2,3,5]
``