Created
April 5, 2015 06:08
-
-
Save lelinhtinh/3f0fe8abe75b34387f61 to your computer and use it in GitHub Desktop.
Tìm vị trí của số nhỏ nhất trong mảng các số
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arrayMinimumIndex(inputArray) { | |
var indexOfMinimum = 0; | |
for (var i = 1; i < inputArray.length; i++) { | |
if (inputArray[i] < inputArray[indexOfMinimum]) { | |
indexOfMinimum = i; | |
} | |
} | |
return indexOfMinimum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment