Answer the question
In order to leave comments, you need to log in
How to access two identical objects?
Hello. An array comes from the server
. It contains one or more objects. For example, there are two;(2) [{…}, {…}]
0: {id: 489, name: "Nickname"}
1: {id: 345, name: "Email"}
length: 2
__proto__: Array(0)
<div>
<div>{data.map((dat, index) => {
if(dat) {
for (let i=0; i< dat.length; i++) {
return (
<Link> {dat[i].name}</Link>
)
}}}
})}</div>
Answer the question
In order to leave comments, you need to log in
Correct option.
let data = [
{id: 489, name: "Nickname"},
{id: 345, name: "Email"}
];
<div>
{
data.map((dat, index) => {
return (
<Link>{dat.name}</Link>
)
})
}
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question