Javascript assiging multiple values to `ternary` operator

Viewed 4429

How to assign multiple values to ternary operator? is that not possible? I tried like this, but getting error:

size === 3 ? (  var val1=999,  var val2=100; )  : 0;

and

size === 3 ? (  var val1=999; var val2=100; )  : 0;

above both approach throws error. how to set both var val1 and var val2;

I can directly declare it. But I would like to know the ternary operator approach here.

7 Answers
Related