how to map object in react code example
Example: how to map array of objects in react
[{
name: 'Sam',
email: '[email protected]'
},
{
name: 'Ash',
email: '[email protected]'
}
].map( ( {name, email} ) => {
return <p key={email}>{name} - {email}</p>
})