i start from 1 (#78)

This commit is contained in:
Денис
2018-07-19 02:03:20 +03:00
committed by Aditya Bhargava
parent a15b071134
commit 48f971e361

View File

@@ -8,7 +8,7 @@ function findSmallestIndex(array) {
var smallestElement = array[0]; // Stores the smallest value
var smallestIndex = 0; // Stores the index of the smallest value
for (var i = 0; i < array.length; i++) {
for (var i = 1; i < array.length; i++) {
if (array[i] < smallestElement) {
smallestElement = array[i];
smallestIndex = i;