function calculateViewAmount(uploads){
    let viewCounter = 0;

    for(const checkUpload of uploads){
      // console.log(checkUpload);

      let stringToCheck;
      if(within == 'alltime'){
        stringToCheck = 'viewsAllTime';
      } else {
        stringToCheck = `viewsWithin${within}`;
      }
      const forThisUpload = checkUpload[stringToCheck];
      viewCounter = viewCounter + forThisUpload;
    }
    return viewCounter;
  }
GET /media/popular
Page with all popular