javascript - React JS: Rendering object keys and its values -
i trying render objects key , value, doesn't seem work.
i have managed display in console, not actual dom. iterating through object has multiple entries.
what need print out values?
{attributes.map(items => { {object.keys(items).map((key) => { console.log(key, items[key]); })} })}
like this:
{attributes.map((items, index) => { return ( <ul key={index}> {object.keys(items).map((key) => { return ( <li key={key + index}>{key}:{items[key]}</li> ) })} </ul> ) })}
Comments
Post a Comment