Skip to content

Instantly share code, notes, and snippets.

@dzaima
Created January 28, 2018 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dzaima/605ba891220673a921d9795638c89e2c to your computer and use it in GitHub Desktop.
Save dzaima/605ba891220673a921d9795638c89e2c to your computer and use it in GitHub Desktop.
Object.keys(progressReportGames).map(c=>progressReportGames[c].teams.map(c=>({
name: document.querySelector(`.team-${c.id} .player`).innerHTML,
id: c.id,
food: c.food,
workers: c.workers,
score: c.score
})))
var res = [];
Object.keys(progressReportGames).forEach(key => {
var game = progressReportGames[key];
var rg = [];
rg = game.teams.map(c => ({id: c.id, name: document.querySelector(`.team-${c.id} .player`).innerHTML, food: c.food, workers: c.workers, score: c.score}))
res.push(rg);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment