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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -