function videosByYear(videos) {
  const result = {};
  videos.forEach((video) => {
    const publishedAtMoment = moment(video.snippet.publishedAt);
    const year = publishedAtMoment.year();
    if (!result[year]) {
      result[year] = [];
    }
    result[year].push(video);
  });
  return result;
}
Splits a list of videos by year published.

@param {!Array} videos The array of videos to split.
@return {!Object} A list of videos split by year.