公告
财富商城
积分规则
提问
发文
2019-01-11 18:14发布
等我变得足够好
Can this be done in JavaScript?
type == 1 ? function1() : function2();
Yes, that's valid code. It will invoke either function1() or function2(), but not both - depending on the value of type.
function1()
function2()
type
It won't invoke two functions. It will invoke one of your two functions.
最多设置5个标签!
Yes, that's valid code. It will invoke either
function1()
orfunction2()
, but not both - depending on the value oftype
.It won't invoke two functions. It will invoke one of your two functions.