function bubbleSort(inputArr) {
const arr = [...inputArr];
for (let i = 0; i < arr.length - 1; i++) {
for (let j = 0; j < arr.length - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
// ⬇ Swap two elements using Destruturing assignment
[arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
// Break our loop if during inner loop execution there was no swaps