lodash

Lodash Get For Safer and Readable Code

Yesterday, I tweeted about how often I encounter people opposed to using Lodash in their projects. I'm frequently surprised how many people refuse to allow Lodash in their projects. I get it. However, I can't live without `_.get`. It's a life saver and prevents…

Lodash Memoize with a Resolver

A while back, I wrote about Lodash Memoize. However, I missed a critical point about it that Pavel Zubkou pointed out. memoize uses the first argument to create the key to the cache. If the method you want to memoize takes more than one argument, the additional ones would get…

Understanding Lodash Memoize

I work on a team that has some really great developers. A few days ago in a PR review, I came across: const formatNumberFull = memoize(number => numeral(number).format("0,0")); Ummm... what? The Lodash docs gave me a little better understanding of what memoize does, but I didn't…