score:0

Accepted answer

you can check if property exits or not: {res.age ? res.age : ''}

score:0

below structure of data looks weird :

{
     ["name": "max", "age":15, "country": 1],
     ["name": "muster", "country": 56],
     ["name": "test", "age": 5, "country": 5]
}

but, you can use a safe operator for that :

 {res?.age ?? ''} // empty string will be returned in case res == null or undefined

working demo :

edit so-react-safe-operator


Related Query

More Query from same tag