Array variable (#259)

The array is set in one place.
This commit is contained in:
ViMaCode
2024-03-22 23:10:02 +03:00
committed by GitHub
parent 256625afd7
commit f7ccf02e00

View File

@@ -40,7 +40,7 @@ function selectionSort(array) {
}
const sourceArray = [5, 3, 6, 2, 10];
const sourtedArray = selectionSort([5, 3, 6, 2, 10]);
const sourtedArray = selectionSort(sourceArray);
console.log("Source array - ", sourceArray); // [5, 3, 6, 2, 10]
console.log("New sorted array - ", sourtedArray); // [2, 3, 5, 6, 10]