Keys and values

Now it's time to turn our attention to object keys and values and how they can be used in function call chains. Often, these involve wrapping a plain object in a Lo-Dash instance and then using the keys() or values() functions to bootstrap the processing. There are also times when you have a collection of objects and you want to work with certain property values only. For this purpose, there are the pick() and omit() functions that can be exercised in chains.

Filtered keys and values

We can use the result of a filtered array of object keys at a later point in the chain. This comes in handy when we're not exactly sure which keys are available and we only have a best guess. Let's try filtering by keys and values:

var object = { firstName: ...

Get Lo-Dash Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.