Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var projections = Object.keys(serverData)
.map(function(k) {
return serverData[k].totals.map(function(t, i) {
var row = { y: i + 1 }
row[serverData[k].commissionStructure] = t.total.value
return row
})
})
var result = projections[0]
projections.forEach(function(projection) {
projection.forEach(function(row, i) {
Object.keys(row).forEach(function(k) {
result[i][k] = row[k]
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment