Do you know is there a way of null guarding a destructure that happens inside a map?
For example, if my array's first element's age is null then is there a way of writing it so that it doesn't crash when iterating over the destructured values?
export function Component(array) {
return (
<>
{array.map(({ name, age }) => (
<>
<div>{name}</div>
<div>{age}</div>
</>
))}
</>
)
}
I know with destructuring you can use this pattern to allow the assignment of null values be assigned and not crash
const {name, age} = {...array}
Is it possible to do a similar thing inside the map?