From f7ccf02e001c06f39a65684bfd3540c0f8476ba7 Mon Sep 17 00:00:00 2001 From: ViMaCode <59506333+Vitalii-Maevskii@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:10:02 +0300 Subject: [PATCH] Array variable (#259) The array is set in one place. --- 02_selection_sort/javascript/01_selection_sort.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_selection_sort/javascript/01_selection_sort.js b/02_selection_sort/javascript/01_selection_sort.js index afc0a4b..c9cf695 100644 --- a/02_selection_sort/javascript/01_selection_sort.js +++ b/02_selection_sort/javascript/01_selection_sort.js @@ -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]