JSFiddle - React, Tailwind, and code Playground

by Adam Boduch

HTML

<script src="https://rawgit.com/lodash/lodash/master/dist/lodash.min.js"></script>

JavaScript

var arr =[{
    "x": {
        "id": "123"
    },
    "y": {
        "value": "123"
    }
}, {
    "x": {
        "id": "256"
    },
    "y": {
        "value": "256"
    }
}, {
    "y": {
        "value": "789"
    }
}];

console.log('y', _.map(arr, 'y.value'));
console.log('x', _.get(_.findLast(arr, _.unary(_.partialRight(_.has, 'x'))), 'x.id'));