Under Construction...
All credit goes to the author of https://russplaysguitar.github.io/UnderscoreCF
What a beautiful and useful CFML Library for bringing in JAVASCRIPT like underscore util functions into play.
I pretty much used every function from there and also extended little for my use cases or as and when required.
One of such a method is "enhance". It's easy to implement by using underscore other method.
So this _.enhance method come in handy when "CFML - how to inject a property or field into existing array of objects"
/* _.enhance (arrOfObjs, {color:'red'}) ===> this willl add "color" property into all the existing array of objects names = []; arrayAppend(names, {"value" : "meens"}); arrayAppend(names, {"value" : "sundar"}); writedump(_.enhance (names, {age:'40'}));Result will have {age:40} injected into each struct (object) in the array.idea from stackoverflow ; */ public any function enhance(list, source) { return _.map(list, function(element) { return _.extend({}, element, source); }); }