Skip to content

Instantly share code, notes, and snippets.

@trufa
Last active September 11, 2018 13:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trufa/cc3bd3ef314ce973c21c73bcc2ecdb29 to your computer and use it in GitHub Desktop.
Save trufa/cc3bd3ef314ce973c21c73bcc2ecdb29 to your computer and use it in GitHub Desktop.
const col = 3;
const row = 3;
const listOfPos = [];
for (var i = 0; i < row; i++) {
for (var j = 0; j < col; j++) {
listOfPos.push({
x: j,
y: i,
});
}
}
console.log(listOfPos);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment