JSFiddle - React, Tailwind, and code Playground
by alexmac
HTML
<script src="https://raw.githubusercontent.com/lodash/lodash/4.10.0/dist/lodash.js"></script>
JavaScript
var objs = {
obj1 : [{ amount: 5, new: true }, { amount: 3, new: false }],
obj2: [{ amount: 10, new: true }, { amount: 2, new: false }]
};
var result = _(objs)
.map(value => value)
.flatten()
.filter((obj) => obj.new)
.orderBy('amount', 'desc')
.first();
console.clear();
console.log(result)