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();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No.
The ternary operator is a good way to do a simple “If A x = y ELSE x = z”. Trying to go beyond that is a good way to create an unreadable mess.
Use a proper
if { } else { }.Readability is far more valuable then shortness.