Book Image

Lo-Dash Essentials

By : Adam Boduch
Book Image

Lo-Dash Essentials

By: Adam Boduch

Overview of this book

Table of Contents (15 chapters)
Lo-Dash Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 2. Working with Objects

Everything in JavaScript is an object. This includes functions, arrays, and strings. There's also the notion of a plain object—a dictionary of key-value pairs. This latter structure is useful when you need support with looking up values by a key. In other words, something that a programmer would likely want to read—instead of a numerical index found in arrays.

Lots of APIs return JSON data—you'll often find plain objects. While you can achieve much using JavaScript objects on their own, Lo-Dash makes life easier for doing common things with objects. These functions make the mundane a little less boring as you'll soon find out, you can often find a less verbose approach to working with objects.

In addition to plain object access and manipulation, Lo-Dash has several utility functions that can be applied to any object in your code. These are mostly concerned with validating the type of object you're working with, a duplicitous task using Vanilla JavaScript.

In...