a function for quick sort algorithm using underscore naming convention for naming variables and functions
function qSort (arr) { if (arr.length < 2) return arr const result = [] const left = [] const right = [] const pivot = arr[0] for (let i = 1, len = arr.length; i < len; i++) { if (arr[i] < pivot) left.push(arr[i]) else right.push(arr[i]) } return result.concat(qSort(left), pivot, qSort(right)) }