Hi I am wondering if there is a good way to run multiple functions or methods if a condition is met within short-hand javascript.
I have tried this, but doesn't work:
!gameView?launchFull(); alert('action 2'):returnView();
Can you do it? Yes.
Working example
var x = true;
!x?(alert('true 1'),alert('true 2')):(alert('false 1'),alert('false 2'));
Note brackets around the sections.
But, should you do it? no.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With