Bubble Sort

Code

function bubbleSort(ar) {
  for (let i = 0; i < ar.length; i++) {
    for (let j = 0; j < ar.length - 1 - i; j++) {

      if (ar[j]['value'] > ar[j + 1]['value']) {
        swap(ar, j, j + 1);
      }
    }
  }
}

function swap(ar, i, j) {
  const temp = ar[i];

  ar[i] = ar[j];
  ar[j] = temp;
}

Search