summary.detentionComments = [];
$.map(summary.detentionNotes, function(note) { summary.detentionComments.push(note.comments) });
summary.detentionComments = summary.detentionComments.join("; ");
Refactorings
No refactoring yet !
Adam
June 3, 2011, June 03, 2011 14:16, permalink
summary.detentionComments = summary.detentionNotes.map(function(note) { return note.comments }).join("; ");
https://www.google.com/accounts/o8/id?id=AItOawmRvMhcLFwL72d7b-9gx7YpThiobwkY3Co
June 3, 2011, June 03, 2011 15:45, permalink
Ahh, of course, seems so simple now! Thanks!
I just can't help but feel like this could be done in a much smoother way, but I'm not sure how to easily gather all the values I need in a separate array so I can join them together in a string afterwards. Any ideas?