insertion-sort

Insertion sort

insertion-sort

Stability: 1 - Experimental

Insertion sort.

var insertionSort = require('insertion-sort');
...
var ascending  = insertionSort(array);        // sort ascending 
var descending = insertionSort(array, false); // sort descending