I have a json file with data that gets passed into a component. Some objects have all 3 variables and some have some data missing. We want to display something like:
-Alice, Seattle WA
but if Seattle and WA aren't present we want to display just
-Alice
And vice versa. And hide the hyphen if nothing is present. What's the cleanest way to do this?
<div>
- {item.name}, {item.city} {item.state}
</div>