scripts/index.js
/** Ensure the teams array has all the teams with the right names */
Ensure the teams array has all the teams with the right names
Ensure the teams array has all the teams with the right names
function updateTeamNames() {
    teams = [];
    let teamNames = $(".teams-list").children().toArray().map(x => x.innerHTML);
    teamNames.forEach((t, i) => {
        teams.push({ index: i, name: t, score: 0 });
    });
}
function updateTeamNames ( ) { teams = [ ] ; let teamNames = $ ( ".teams-list" ) . children ( ) . toArray ( ) . map ( x => x . innerHTML ) ; teamNames . forEach ( ( t , i ) => { teams . push ( { index : i , name : t , score : 0 } ) ; } ) ; }
Ensure the teams array has all the teams with the right names
Ensure the teams array has all the teams with the right names
// Clear it, just in case // Now create a team for each name