Javascript Example Module: Array Min Index (2 Points)

Developed by Professor Tralie and Professor Mongan.

Exercise Goals

The goals of this exercise are:
  1. To do proper array indexing
  2. To use loops in concert with arrays
  3. To keep track of multiple auxiliary variables in a loop
  4. To properly define methods
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:
  1. If there are ties, it should return the lowest index among the ties
  2. If the array is empty, your program should return 0 without crashing
  3. Welcome to our online modules system! Be sure to log in with your Urinus ID before you proceed. For example, Professor Tralie's ID is ctralie. If you are not an Ursinus student, that's fine! Just make something up, and you can still run everything