Using Underscore.js, I can write the following which returns 42:
42
_([42, 43]).chain() .first() .value()
I have custom f
Looks like lodash has implemented exactly what you are looking for:
_.thru(value, interceptor)
from the docs:
This method is like _.tap except that it returns the result of interceptor
https://lodash.com/docs#thru