Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get nested value on object react using dot

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'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nested #object #react #dot
ADD COMMENT
Topic
Name
6+4 =