Skip to content

Instantly share code, notes, and snippets.

@sillyslux
Forked from Franckapik/map.js
Last active May 1, 2020 14:34
Show Gist options
  • Save sillyslux/0d52ffac25f40611c47bfcdd9ae9acb7 to your computer and use it in GitHub Desktop.
Save sillyslux/0d52ffac25f40611c47bfcdd9ae9acb7 to your computer and use it in GitHub Desktop.
let playersList = {};
listeId.map((ident, i) => {
playersList[ident] = {
score : 0,
x : 0,
y : 0
}
})
const playersList = listeId.reduce( (p, c) => ({ ...p, [c]: { score: 0, x: 0 , y:0 } }), {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment