Various sorting algorithms implementations in JavaScript