Ternary Operators in JavaScript Without an "Else"
- by Oscar Godson
I've been using them forever, and I love them. To me they see cleaner and i can scan faster, but ever since I've been using them i've always had to put null in the else conditions that don't have anything. Is there anyway around it? E.g.
condition ? x=true : null ;
basically, is there a way to do:
condition ? x=true;
Now it shows up as a syntax error...