Last active
September 30, 2016 15:16
-
-
Save damienwebdev/178aba0e29ff737f4c88a2c456fa38e4 to your computer and use it in GitHub Desktop.
This file contains 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
var a = [{ | |
id: 1 | |
}, { | |
id: 2 | |
}]; | |
var b = [{ | |
id: 1 | |
}, { | |
id: 2 | |
}]; | |
var c = [{ | |
id: 1, | |
aID: 1, | |
bID: 1 | |
}, { | |
id: 2, | |
aID: 1, | |
bID: 1 | |
}]; | |
var final = [{ | |
"id": 1, | |
"b": [{"id": 1,"c": [{"id": 1},{"id": 2}]}, {"id": 2, "c": []}] | |
}, | |
{ | |
"id": 2, | |
"b": [{"id": 1,"c": []},{"id": 2,"c": []}] | |
}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment