Last active
October 28, 2016 15:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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