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:
Yes, and it does provide a cleaner code than switch statement.. with all the breaks..
inputOne == "Yes" ? "517" : inputOne == "No" ? "518" : inputOneAns = "";