diff --git a/script.js b/script.js index a8c959d..84a8187 100644 --- a/script.js +++ b/script.js @@ -51,7 +51,7 @@ async function fetchScheduleData(year) } catch (error) { - alert(`Something went wrong when trying to fetch the data for year "${year}".`); + alert(`Something went wrong when trying to fetch the data for year "${year}".`); console.log(error); } } @@ -62,11 +62,6 @@ function displayScheduleData(data) const teamsArr = data['teams']; const activeMatchupPeriods = data['status']['currentMatchupPeriod']; - // console.log("Schedule Array: ", scheduleArr, "Length: ", scheduleArr.length); - // console.log("Teams Array: ", teamsArr); - // console.log(`Found ${activeMatchupPeriods} active matchup periods.`); - - // Extract data from each matchup period one at a time. for (let i = 1; i <= activeMatchupPeriods; i++) { matchupPeriodScheduleArr = scheduleArr.filter((matchup) => matchup['matchupPeriodId'] === i); @@ -105,8 +100,8 @@ function extractMatchupData(matchup, teams) const homeTotalPoints = homeTeam['totalPoints']; // TODO: Fix this code block when viewing data from 2025. - // const awayPointsArr = pointsObjToArr(awayTeam['pointsByScoringPeriod']); - // const homePointsArr = pointsObjToArr(homeTeam['pointsByScoringPeriod']); + const awayPointsArr = pointsObjToArr(awayTeam['pointsByScoringPeriod']); + const homePointsArr = pointsObjToArr(homeTeam['pointsByScoringPeriod']); let string = ""; @@ -180,6 +175,70 @@ function extractMatchupData(matchup, teams) { div.innerHTML += `