【发布时间】:2021-09-19 22:18:00
【问题描述】:
我正在尝试将这个 if 语句写在这里作为 switch 语句
if (value < 2500) {
paystackFees = value * 0.015;
};
if (paystackFees > 2000) {
paystackFees = 2000
};
【问题讨论】:
-
这里不能使用switch,因为switch不能进行逻辑运算(比如大于
<)。但是,您可以改用else if
标签: javascript if-statement switch-statement