If visible, show:
---
const isVisible = false;
---
{
isVisible &&
<h1>{obj.favorites[1].toUpperCase()}</h1>
}
If visible show first line, otherwise second line:
{
isVisible &&
? <h1>{obj.favorites[1].toUpperCase()}</h1>
: <h1>{obj.favorites[0].toUpperCase()}</h1>
}
Shorter version:
<h1>{obj.favorites[isVisible ? [1] : [0]].toUpperCase()}</h1>
Loop through data:
<ul>
{
obj.favorites.map(item => (
<li>{item}</li>
))
}
</ul>