I have an array of objects as folllows
[ {\"width\":128.90663423245883,\"height\":160,\"X\":0,\"Y\":140}, {\"width\":277.0938568683375,\"height\":263,\"X
function count(stack) { var totWidth = 0; stack.forEach(function(element) { totWidth = totWidth+element.width; }); return totWidth; }
working example