JS Ternary functions with multiple conditions?
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: var inputOneAns = inputOne == "Yes" ? "517" : "518"; As you can see, I am assigning a numeric string value to inputOneAns 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 inputOneAns . Is there a wayf or me to embed an ternary operator inside of another ternary operator? To help