title: JS Ternary functions with multiple conditions?
body: <p>I have been using a ternary operator in JavaScript to modify the value of an object based on user input. I have the following code, which runs as it should:</p>
  
  <pre><code>var inputOneAns = inputOne == "Yes" ? "517" : "518";
  </code></pre>
  
  <p>As you can see, I am assigning a numeric string value to <code>inputOneAns</code>whether a user has inputed "Yes" or "No". However, there may be a case that a user has not selected a value (as it is not required). If this input was left blank, I would like to assign an empty string "" to <code>inputOneAns</code>. Is there a wayf or me to embed an ternary operator inside of another ternary operator? To help clarify, here is the same function that I want to accompolish with my ternary function but with if else statements?</p>
  
  <pre><code>if (inputOne == "Yes"){
      var inputOneAns = "517"
  }else if (inputOne == "No"{
      var inputOneAns = "518"
  }else{
      var inputOneAns = ""
  }
  </code></pre>
  
  <p>Is it possible to include multiple expressions into a ternary function? Is there a better way to accomplish what I am looking for? Thanks for the tips in advance.</p>