Lesson on Reduce

function combineFavorites(accumulator, currentValue) {
  console.log(`Current accumulator: ${accumulator}`)
  console.log(`Current currentValue: ${currentValue}\n`)
  if (!accumulator[currentValue]) {
    accumulator[currentValue] = 1
  } else {
    accumulator[currentValue]++
  }
return accumulator
}

const startingValue = {}

const data = ['red', 'orange', 'red', 'purple', 'pink', 'green', 'red', 'orange', 'pink', 'yellow', 'green', 'pink', 'red'];

data.reduce(combineFavorites, startingValue)