Created
June 30, 2017 23:36
-
-
Save svenliebig/a143e2afe6286eae80fae7c2515bf554 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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