inline if instead of nested if javascri^pt code example
Example: one line if else if statement javascript
var variable = (condition) ? (true block) : ((condition2) ? (true block2) : (else block2))
var variable = (condition) ? (true block) : ((condition2) ? (true block2) : (else block2))