I’m having with my quickSort function returning a string instead of an array. Any advice on how to properly return the values created by the recursion function?

let log = console.log
function quickSort(arr) {
let localArray = arr.slice()
function recursion (array) {
if (array.length<2) {return array}
let lowArray = []
let highArray = []
let pivot = array[0]
for (let i=1;i<array.length;i++) {
if (array[i] < pivot) {lowArray.push(array[i])}
else if (array[i] > pivot) {highArray.push(array[i])}
}
return recursion(lowArray) + pivot + recursion(highArray)
}
return recursion(localArray)
}
let r = quickSort([4,2,3,6,5,8,7,9,0,1])
log(r)
log(typeof r)