Skip to content

Instantly share code, notes, and snippets.

@peterwallhead
Forked from joshgillies/pw-hax.js
Last active August 29, 2015 13:56
Show Gist options
  • Save peterwallhead/9244449 to your computer and use it in GitHub Desktop.
Save peterwallhead/9244449 to your computer and use it in GitHub Desktop.
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