Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lelinhtinh/3f0fe8abe75b34387f61 to your computer and use it in GitHub Desktop.
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ố
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