```js
var size = attachments.reduce(function(size, attachment) {
  return (size += attachment.content.size);
}, 0);
```