Skip to content

Instantly share code, notes, and snippets.

@ozten
Created November 11, 2013 16:43
Show Gist options
  • Save ozten/7416238 to your computer and use it in GitHub Desktop.
Save ozten/7416238 to your computer and use it in GitHub Desktop.
Working with multi-dimensional arrays of various sizes using constants and functions
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