Skip to content

Commit 48f971e

Browse files
corvus-007egonSchiele
authored andcommitted
i start from 1 (egonSchiele#78)
1 parent a15b071 commit 48f971e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

02_selection_sort/javascript/01_selection_sort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function findSmallestIndex(array) {
88
var smallestElement = array[0]; // Stores the smallest value
99
var smallestIndex = 0; // Stores the index of the smallest value
1010

11-
for (var i = 0; i < array.length; i++) {
11+
for (var i = 1; i < array.length; i++) {
1212
if (array[i] < smallestElement) {
1313
smallestElement = array[i];
1414
smallestIndex = i;

0 commit comments

Comments
 (0)