const data = [{
"detectedLanguage": {
"language": "hi",
"score": 1
},
"translations": [{
"text": "long steff",
"to": "en"
}]
}]
How do I console.log only the translation.text
field?
I tried console.log(JSON.stringify(res.data.translation.text)
but that gives me the following error:
TypeError: Cannot read property 'text' of undefined