src/index.js
function summarizeContributions(contributions) {
  let busiestDay = null;
  let total = 0;
  contributions.forEach(d => {
    if (d.count > 0 && (!busiestDay || d.count > busiestDay.count)) {
      busiestDay = d;
    }
    total += d.count;
  });
  return {
    busiestDay,
    end: contributions.slice(-1)[0].date,
    start: contributions[0].date,
    total
  };
}
function summarizeContributions(contributions) {
  let busiestDay = null;
  let total = 0;
  contributions.forEach(d => {
    if (d.count > 0 && (!busiestDay || d.count > busiestDay.count)) {
      busiestDay = d;
    }
    total += d.count;
  });
  return {
    busiestDay,
    end: contributions.slice(-1)[0].date,
    start: contributions[0].date,
    total
  };
}
function summarizeContributions ( contributions ) { let busiestDay = null ; let total = 0 ; contributions . forEach ( d => { if ( d . count > 0 && ( ! busiestDay || d . count > busiestDay . count ) ) { busiestDay = d ; } total += d . count ; } ) ; return { busiestDay , end : contributions . slice ( - 1 ) [ 0 ] . date , start : contributions [ 0 ] . date , total } ; }
Summarize list of contribution

@param {Array<{date: string, count: number}>} contributions - List of contribution
@return {{end: string, start: string, total: number, busiestDay: {date: string, count: number}}}
Summarize list of contribution