Re:Node_modules: One character saved 50 GB of disk space
by samatman on Sunday October 02, 2022 @07:22AM
(#33054944)
Yes, and this sort of application (pun intended) is what the one-liner library is for.
If you have a function isEqualTo(a, b), you can curry(isEqualTo, 5) and filter with it.
`assign` could be used in the same way for assigning/overwriting the same field in an array of Objects, and so on.
My mental model of assign was backwards, and it took me a while to comprehend why their implementation would be data-last.
So, the data is the object that is being modified? And the idea is it lets you write stuff like this more easily: