const _quickSort = array => { if(array===null||array.length===0) return array; let first = array[0]; let left = []; let right = []; for(let i = 1; i <array.length;i++){ if(array[i]<first){ left.push(array[i]) }else{ right.push(array[i]) } } left = _quickSort(left); right = _quickSort(right); return left.concat([first],right); } _quickSort([-1,2,3,44,55,33,11,44,556]);