// Bubble Sort — the largest value "bubbles" to the end each pass.// Just sort arr normally — every read and write is visualized for you.const n = arr.length;for (let i = 0; i < n - 1; i++) {for (let j = 0; j < n - i - 1; j++) {if (arr[j] > arr[j + 1]) {const tmp = arr[j];arr[j] = arr[j + 1];arr[j + 1] = tmp;}}}