helper_functions/polygonsCenters/polygonsCenters.js
/**
  * Returns index of the max element in the array
  * @param {Array.<number>} arr 
  * @return {number} max element in the array
*/
Returns index of the max element in the array
@param {Array.} arr
@return {number} max element in the array
Returns index of the max element in the array @param { Array . } arr @return { number } max element in the array
function findIndexOfMax(arr) {
    let maxIndex = 0;
    let max = arr[0];
    for (let i = 1; i < arr.length; i++) {
        if (arr[i] > max) {
            max = arr[i];
            maxIndex = i;
        }
    }
    return maxIndex;
}
function findIndexOfMax ( arr ) { let maxIndex = 0 ; let max = arr [ 0 ] ; for ( let i = 1 ; i < arr . length ; i ++ ) { if ( arr [ i ] > max ) { max = arr [ i ] ; maxIndex = i ; } } return maxIndex ; }
Returns index of the max element in the array
 @param {Array.<number>} arr
 @return {number} max element in the array
Returns index of the max element in the array @param { Array . <number > } arr @return { number } max element in the array