javascript - Accessing nested objects (and its data) in a map function -


so have object array looks this:

object array

i use map function create html render string this:

var renderbottles =  bottlearray.map(bottle => (   <div> {bottle.bottleid} - {bottle.qty} <a href='#' onclick={ () => this.props.store.del(0)}>x</a></div> )) 

this works fine!

i like, however, access first object during map loop.

highlighted object

because i'm working firebase, name random, question is: how reference object based on location in object array , how retrieve nested data while in map function?

is possible?

nested object data

i've been fiddling while not getting anywhere, appreciate help.

thanks!

if requested object value of type object do

for(var key in bottle) {     if(typeof bottle[key] === 'object') {        // bottle[key] desired object     } } 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -