Skip to content

Instantly share code, notes, and snippets.

@alamsal
Created May 21, 2015 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alamsal/bb6dec312c603324b67b to your computer and use it in GitHub Desktop.
Save alamsal/bb6dec312c603324b67b to your computer and use it in GitHub Desktop.
Multidimensional object array javascript
var indexes = {};
Data.forEach(function(indexPoint){
var zoneIndexes = indexes[indexPoint.zoneId];
if(zoneIndexes == null){
indexes[indexPoint.zoneId] = zoneIndexes = {};
}
zoneIndexes[indexPoint.date] = indexPoint.indexValue;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment