We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a15b071 commit 48f971eCopy full SHA for 48f971e
02_selection_sort/javascript/01_selection_sort.js
@@ -8,7 +8,7 @@ function findSmallestIndex(array) {
8
var smallestElement = array[0]; // Stores the smallest value
9
var smallestIndex = 0; // Stores the index of the smallest value
10
11
- for (var i = 0; i < array.length; i++) {
+ for (var i = 1; i < array.length; i++) {
12
if (array[i] < smallestElement) {
13
smallestElement = array[i];
14
smallestIndex = i;
0 commit comments