Skip to content

Instantly share code, notes, and snippets.

@joshgillies
Created February 27, 2014 04:18
Show Gist options
  • Save joshgillies/9244304 to your computer and use it in GitHub Desktop.
Save joshgillies/9244304 to your computer and use it in GitHub Desktop.
some things for things
var json = {
data: ['a','bunch','of','things']
};
var otherData = {
things: [],
madness: {}
};
json.data.forEach(function(data,index,array){
otherData.things.push(data);
otherData.madness[index] = data;
});
console.log(otherData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment