【发布时间】:2018-09-06 17:41:48
【问题描述】:
我想写:
if ( (val = "") **and**if ((val = "") or (val = "") or (val = "")) ),
那么..
if (val.reduce((acc, val) => acc.concat(val), []).includes("CH Nord Mayenne")
&& val.reduce((acc, val) => acc.concat(val), []).includes('Douleur','Psychologie','Nutrition'))
{ CHNM.addTo(myfrugalmap) ;} else {CHNM.remove();}
我如何写“或”运算符?
【问题讨论】:
-
@zfrisch 呃,不是真的。 OP 希望在
.includes()中有一个 OR 条件 -
示例输入是什么?
-
你试过阅读JavaScript documentation吗?描述了logical OR 运算符,还有哪里?在Logical Operators 部分。
-
顺便说一句,
=是 assignment operator,而不是 comparison operator。
标签: javascript rxjs operator-keyword