function calculateAverageWaitTime (inquires) {
    if (!inquires.length)
        return 0;

    const itemsAmount = inquires.length;
    const summaryWaitTime = inquires.reduce((sum, inquiry) => {
        return sum + (inquiry.processEnded - inquiry.createdAt);
    }, 0);

    return summaryWaitTime / itemsAmount;
}
/**
 * Calculate average inquiry wait time
 * @param {Array<Inquiry>} inquires
 * @return {Number} Average wait time in ms
 */
Calculate average inquiry wait time
@param {Array} inquires
@return {Number} Average wait time in ms
Calculate average inquiry wait time @param { Array } inquires @return { Number } Average wait time in ms
function calculateAverageWaitTime (inquires) {
    if (!inquires.length)
        return 0;
    const itemsAmount = inquires.length;
    const summaryWaitTime = inquires.reduce((sum, inquiry) => {
        return sum + (inquiry.processEnded - inquiry.createdAt);
    }, 0);
    return summaryWaitTime / itemsAmount;
}
function calculateAverageWaitTime ( inquires ) { if ( ! inquires . length ) return 0 ; const itemsAmount = inquires . length ; const summaryWaitTime = inquires . reduce ( ( sum , inquiry ) => { return sum + ( inquiry . processEnded - inquiry . createdAt ) ; } , 0 ) ; return summaryWaitTime / itemsAmount ; }
Calculate average inquiry wait time
 @param {Array<Inquiry>} inquires
 @return {Number} Average wait time in ms
Calculate average inquiry wait time @param { Array<Inquiry > } inquires @return { Number } Average wait time in ms