type == 1 ? function1() : function2();
Yes, that's valid code. It will invoke either
function2(), but not both - depending on the value of
It won't invoke two functions. It will invoke one of your two functions.
©2020 All rights reserved.