Simple SortedArray for JavaScript