I am trying to write a long if else if
(!contract.hasOwnProperty('COMMIT_CONTRACT') ? '1') : (contract.hasOwnProperty('COMMIT_CONTRACT') ? '2' : '3')
However, this is failing to evaluate.
I started with:
(!contract.hasOwnProperty('COMMIT_CONTRACT')) ? '1' : '2')
But according to here you can chain them: javascript shorthand if statement, without the else portion
But it's not evaluating correctly. What am I doing wrong and how do I fix it?