I'm new to JS and having some difficulties with the syntax. Could you please advise what is wrong with my code syntax since it returns this on my page instead of the label name/id value:
[object Object]
My code snippet:
{The success message is ${(firstValue || secondValue) ? <FormattedMessage id="success.label.name" /> : '-'}}
You displayed object.
You can try like this. Example
valObj = {
"name": 'value',
"id": 'value'
}
Object.entries(valObj).map(([key, val]) =>
<h2 key={key}>{key}: {val}</h2>)