Created
November 11, 2013 16:43
-
-
Save ozten/7416238 to your computer and use it in GitHub Desktop.
Working with multi-dimensional arrays of various sizes using constants and functions
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 GROUP = 0; | |
var SUB_GROUP = 1; | |
... | |
releases[GROUP]; | |
releases[SUB_GROUP]; | |
function getGroup(data, releaseOffset) { | |
return data[GROUP + index]; | |
} | |
function getNameFromGroup(groupData) { | |
return groupData[GROUP_NAME]; | |
} | |
/// first thing's group it would be 0 + 0 | |
/// first thing's group's subgroup it would be 1 + 0 | |
/// second thing's group it would be 2 + 0 | |
/// second thing's subgroup | |
var data = [ | |
[ | |
[], // thing 1 group | |
[] | |
],// thing 2 sub-group | |
[ | |
[], // thing 2 group | |
[] | |
], // thing 2 sub-group | |
] | |
data[23][34]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment