JSFiddle - React, Tailwind, and code Playground

by Avi Algaly

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>

JavaScript

const res = _.find([{
  a: 1
}, {
  a: 2
}, {
  a: 3
}, {
  a: 4
}, {
  a: 5
}, {
  a: 6
}], function(itm) {
  if (itm.a===3) {return itm}
});
alert(res.a)