1// MDN Ref:
2// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
3
4var result = jsObjects.find(obj => {
5 return obj.b === 6
6});
1function getByValue2(arr, value) {
2
3 var result = arr.filter(function(o){return o.b == value;} );
4
5 return result? result[0] : null; // or undefined
6
7}
8