title: How to use a ternary operator in a template literal with multiple variables
body: <p>I have a JSON file that I'd like to get values from and display. I tried to use a ternary operator but I couldn't seem to get the output I wanted since I have multiple variables. Here's what I tried:</p>
  
  <pre><code>//If there's a word, display its character / reading. Otherwise, just display the reading
  return `${json.data[0].word} ? ${json.data[0].word (${json.data[0].reading}) : ${json.data[0].reading}`
  
  
  </code></pre>
  
  <p>This just outputs the actual string but with undefined if json.data[0].word is undefined. I'd like to only display the reading in this case.</p>