Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save svenliebig/a143e2afe6286eae80fae7c2515bf554 to your computer and use it in GitHub Desktop.
Save svenliebig/a143e2afe6286eae80fae7c2515bf554 to your computer and use it in GitHub Desktop.
arr = [{
cedattribute: 1,
svenattrubute: 2
}, {
cedattribute: 3,
svenattrubute: 4
}];
function transformObj(objectOld) {
var newObj = {};
newObj.cedattribute = objectOld.cedattribute;
return newObj;
}
function transformArray(arrayToTransform) {
var newArray = [];
for(let ob of arrayToTransform) {
newArray.push(transformObj(ob));
}
return newArray;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment