The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Safer property access with Lodash's 'get' method

Safer property access with Lodash's 'get' method

8:36
Property access in Javascript can be problematic - especially when dealing with nested Objects and Arrays. Doing it manually and in a safe manner requires tons of boilerplate inside conditionals and results in a defensive style of coding. In this lesson we look at why this is a problem & how to overcome it using the `get` method from the popular utility library `Lodash`
Watch this lesson now
Avatar
egghead.io

Property access in Javascript can be problematic - especially when dealing with nested Objects and Arrays. Doing it manually and in a safe manner requires tons of boilerplate inside conditionals and results in a defensive style of coding. In this lesson we look at why this is a problem & how to overcome it using the get method from the popular utility library Lodash

Avatar
Francis

This feature was one of my favorite reasons for using Ractive. I think they do it better arrays too, allowing for index dot notation. Ex: details.pets.0.name

In reply to egghead.io
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?