Can one do more than the other? Should I stick with lodash or just use ES6's map method?
Besides @georg's comment on the possibility of using lodash _.map
as a shorthand for _.property
, lodash map can be used for any iteratable, whereas ES6 map can only be used for arrays.
They're both compliant with the ECMA-262 spec, so they're identical. However, for portability (and perhaps performance/readability), I personally prefer the built-in ES6 map method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With