Using ternary operator in JavaScript to invoke two functions

前端 未结 2 1414
深忆病人
深忆病人 2020-12-03 10:47

Can this be done in JavaScript?

type == 1 ? function1() : function2();
2条回答
提交回复
热议问题