Javascript Example Module: Array Min Index (2 pts)
Explorer
GitHub
Connect to GitHub to push and pull your project files to a repository.
On the page that opens, create a token with repo scope, copy it, then paste it below.
Paste the personal access token you created on GitHub with repo scope.
Click Refresh to load commit history
Exercise Info
Goals
To do proper array indexing
To use loops in concert with arrays
To keep track of multiple auxiliary variables in a loop
To properly define methods
Instructions
Fill in the function getMinIndex, which takes in an array numerical values and which should return the index of the minimum element in the array. You must handle the following two special cases:
If there are ties, it should return the lowest index among the ties
If the array is empty, your program should return 0 without crashing