Draft
 

A simple bubble sort function.

sort.js
const bubbleSort = (arr) => {
  for (let i = arr.length - 1; i >= 0; i--){
    for(let j = 1; j <= i; j++){
      if(arr[j - 1] > arr[j]){
        const temp = arr[j - 1];
        arr[j - 1] = arr[j];
        arr[j] = temp;
      }
    }
  }
  
  return arr;
}
by Tobias Herber