DEV Community

Discussion on: Lodash and Underscore, is there still a case?

 
adam_cyclones profile image
Adam Crockett πŸŒ€ • Edited
const arr = [{
    firstName: 'John',
    lastName: 'Smith',
    offspring: [{
        name:'Katie', 
        gender: 'F'
    }, {
        name: 'Mark',
        gender: 'M'
    }],
    {
        firstName: 'Jill', 
        lastName: 'Jones', 
        offSpring: [{
            name: 'Doug', 
            gender: 'M'
        }]
    }
];

arr.find(person => person.offspring.find ... // Point taken this is a bit more wordy😁
Thread Thread
 
amyblankenship profile image
AmyBlankenship

So in other words, you can't do it out of the box with ES6 functions--you have to write additional functionality yourself (which your team is then responsible for testing and maintaining).