I want to chain Lodash Array methods interchangeably with ES6 Array methods without using _chain and in a Functional Programming style.
I want to do this:
import {flatMap} from 'lodash';
const result = my2DimensionalArray.flatmap().map(i => {
return `${i}-blergh`;
});
I get this isn't really possible without extending native Array Protoytpe.
I'm currently working like this:
import _ from 'lodash';
_(my2DimensionalArray).flatMap().value().map(i => {
return `${i}-blergh`;
});
Can I improve this somehow? How are other people doing the same thing?