Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 724 Bytes

or.md

File metadata and controls

32 lines (20 loc) · 724 Bytes
标题 标签
or(逻辑或) math,logic(数学,逻辑)

检查至少一个参数是否为真。

  • 对两个给定值使用逻辑或 (||) 运算符。
const or = (a,b) => a || b;

调用方式:

or(true, true); // true
or(true, false); // true
or(false, false); // false

应用场景

以下是一个实战示例:

结果如下:

<iframe src="codes/javascript/html/or.html"></iframe>