function isItRealSelectionSort(array) { for (let i = 0; i < array.length; i++) { for (let j = 0; j < array.length; j++) { if (array[i] < array[j]) { let temp = array[j]; array[j] = array[i]; array[i] = temp; } } } return array; } const notSortedArray = [32, 34, 244, 7, 45, 57, 234, 5, 90, 35, 3546, 567, 32]; const sorted = isItRealSelectionSort(notSortedArray); console.log(sorted); console.time('selection'); isItRealSelectionSort(notSortedArray); console.timeEnd('selection');