Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to print an array inside another array in react

  return(
    <div>
      {Object.keys(data).map((key) => {
         return (
           <div key={key}>
              <h1>{key}</h1>
              {data[key].map((dataItem) => {
                return (
                 <span key={dataItem.user}>{dataItem.id}</span>
                )
               })}
           </div>
         )
       })}
     </div>
   )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #array #array #react
ADD COMMENT
Topic
Name
2+3 =