i am trying to read the array elements into the object as follows
function points(games){
let scoreBoard = {};
for(let i = 0 ; i < games.length ; i++){
let otherTeam = 0;
let ourTeam = games[i][0];
for(let j = 0 ; j < games[i].length; j++){
otherTeam = games[i][j];
}
scoreBoard[ourTeam] = otherTeam;
}
return scoreBoard;
}
console.log(points(["1:0","2:0","3:0","4:0","2:1","3:1","4:1","3:2","4:2","4:3"]));
I want it to read in in the [x:y] format, i am missing something. Can you please help me ?