fp.js
function sortedIndex(list, value, valueIndex) {
    if (!(list && Array.isArray(list))) {
      // Manually currying
      let args = arguments;
      return (list) => sortedIndex(list, ...args);
    }

    return reuseables.sorter(list, value, valueIndex);
  }
function sortedIndex(list, value, valueIndex) {
    if (!(list && Array.isArray(list))) {
      // Manually currying
      let args = arguments;
      return (list) => sortedIndex(list, ...args);
    }

    return reuseables.sorter(list, value, valueIndex);
  }
function sortedIndex ( list , value , valueIndex ) { if ( ! ( list && Array . isArray ( list ) ) ) { // Manually currying let args = arguments ; return ( list ) => sortedIndex ( list , ... args ) ; } return reuseables . sorter ( list , value , valueIndex ) ; }
Returns the lowest index number of a value if it is to be added to an array.
@param list {Array} array that value will be added to
@param value value to evaluate
@param valueIndex {string} accepts either 'first' or 'last'.
Specifies either to return the first or last index if the value is to be added to the array.
Default is 'first'
@returns {number}
Returns the lowest index number of a value if it is to be added to an array .