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 r = inputOne == "" ? "" : ( inputOne == "Yes" ? "517" : "518");