I want to ask about optimisation in JavaScript if else statement.I have the code like this
if ( thisIsTrue )
printMe("someMessage");
And the code can be optimisation like this
thisIsTrue && printMe("someMessage");
The question is what the code of thisIsTrue && printMe("someMessage"); only works in statement who has been return true.
What if the return is false?
1 Answer