minMaxIndexBy()

Get the index of the (first) minimum value and the index of the (first) maximum value in an array determined by valuer.

This function is valid in v2.12.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{Array} array
Array which contains the minimum and maximum values that should be found and for which the corresponding indices should be returned.
{Function|Array|number|string} valuer
If this is a function it will be passed each item in array and the corresponding values will be used to rank the items. In all other cases this will be used as a path within each item in array whose property at that path will be used to rank the item.

Returns

{Object}
An object containing a min property which will be the index of the (first) minimum value in array. The object will also contain a max property which will be the index of the (first) maximum value in array. If array is empty -1 will be the value of the indices.

Required Function

This function directly requires the following function which is included automatically:

  • minIndex()
    Get the index of the (first) minimum value in an array.

Requiring Function

This function is directly required by the following function:

  • minIndex()
    Get the index of the (first) minimum value in an array.