In addition to the function packages, you can do custom builds of lodash to get exactly the code you need: lodash.com/custom-builds
lodash provides functions to perform set operations like union, intersection and difference on JavaScript arrays
_.memoize creates functions that cache return values for a set of arguments to avoid re-running expensive operations
2
_.result works like _.get, but allows you to accept and evaluate functions as well. This allows for flexible apis.
1
_.get and _.set allow you to safely access and modify deeply nested properties in JavaScript objects.
1
_.throttle spaces out fn calls over a period of time. _.debounce limits fns to a single call within a period of time
lodash provides flexible, powerful alternatives to the native functional array methods like map, reduce, and filter
The tips for this week all relate to the lodash JavaScript library. Most of them will also apply to Underscore (which lodash is a fork of)
It's possible to extract deeply nested values using destructuring. Be careful though, it can get a bit unreadable.
When destructuring objects, you can use key-value pairs to rename the variables you're extracting from an object.
Sometimes it's nice to have functions that take option objects, not a list of params. Destructuring makes that easy.
You can use destructuring to swap variable values in place. (Firefox and Safari only for right now).
ES6 introduced destructuring to JS. Destructuring allows extracting new variables from an existing object or array.
Closures are functions returned by another function that reference variables in the original function scope
1
















