Skip to content

Instantly share code, notes, and snippets.

@jpitchardu
Created May 23, 2018 16:38
Show Gist options
  • Save jpitchardu/6939caa6ad0d26a79c23f628f90cc04f to your computer and use it in GitHub Desktop.
Save jpitchardu/6939caa6ad0d26a79c23f628f90cc04f to your computer and use it in GitHub Desktop.
lodashJS._get example
var object = { 'a': [{ 'b': { 'c': 3 } }] };
_.get(object, 'a[0].b.c'); // => 3
_.get(object, ['a', '0', 'b', 'c']); // => 3
_.get(object, 'a.b.c', 'default'); // => 'default'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment