Skip to content

Instantly share code, notes, and snippets.

@audreybongalon
Last active October 28, 2016 15:38
Show Gist options
  • Select an option

  • Save audreybongalon/d9c241d9336519931a4c2639c301e192 to your computer and use it in GitHub Desktop.

Select an option

Save audreybongalon/d9c241d9336519931a4c2639c301e192 to your computer and use it in GitHub Desktop.
example, for reference for the super tic-tac-toe game. shows how to fill a triple array with items and reference each one
var count = 0;
var letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i"]
var array = [[[], [], []],
[[], [], []],
[[], [], []]];
for (var i = 0; i < 3; i++) {
for (var j = 0; j < 3; j++) {
array[i][j] = letters[count];
count++;
}
}
console.log(array);
// console.log(array[0][1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment