I have this source code, in React function component
return (
result.map(item => (
<tr key={item.id}>
<td>
{new Date(item.pub_date).getFullYear()} /
{new Date(item.pub_date).getMonth()} /
{new Date(item.pub_date).getDate()}
</td>
</tr>
However in this script, it require three Date instances.
I want to shorten like this.
var date = new Date(item.pub_date)
date.getFullYear() / date.getMonth() /date.getDate()
Is it correct idea? or is it impossible to this in JSX??