Sortowanie tablicy bez metody sortowania w JavaScript
let arr = [4, 32, 2, 5, 8];
for (let i = 0; i < arr.length; i++) {
for (let j = i + 1; j < arr.length; j++) {
if (arr[i] > arr[j]) {
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
console.log("Sorted array=>", arr);
Abhishek