QuickSort challenge: built-in.sort method test is not passing

Hi! I’ve implemented quickSort, I know that implementation is not very elegant, but here it is:

function quickSort(array) {
  if(array.length <= 1){
    return array;
  }
  let pivotValue = array[0];
  let lessValues = [];
  let greaterValues = [];
  for(let i=1;i<array.length;i++){
    if(pivotValue < array[i]){
      greaterValues.push(array[i]);
    }else{
      lessValues.push(array[i]);
    }
  }
  
  var sortedLow = quickSort(lessValues);
  var sortedHigh = quickSort(greaterValues);
  //console.log(sortedLow, pivotValue, sortedHigh)
    sortedLow.push(pivotValue);
  var result = sortedLow.concat(sortedHigh);
  return result;
}

And there is what I see in the console when I run the tests:

quickSort should not use the built-in .sort() method.
/

To prevent using the built-in method, that test is just checking if in code there’s somewhere sort. Change names of your variables to not include that and test should pass.

Thank you!
There is a working code:

function quickSort(array) {
  return impl(array);
}

function impl(array){
  if(array.length <= 1){
    return array;
  }
  let pivotValue = array[0];
  let lessValues = [];
  let greaterValues = [];
  for(let i=1;i<array.length;i++){
    if(pivotValue < array[i]){
      greaterValues.push(array[i]);
    }else{
      lessValues.push(array[i]);
    }
  }
  
  var low = impl(lessValues);
  var high = impl(greaterValues);
  
    low.push(pivotValue);
  var result = low.concat(high);
  return result;
}

var arr = quickSort([3,35,3,1,32,4]);
console.log(arr)