Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 808 Bytes

nor.md

File metadata and controls

31 lines (20 loc) · 808 Bytes
标题 标签
nor(逻辑或) math,logic(数学,逻辑)

检查是否所有参数都不为真。

  • 使用逻辑非 (!) 运算符返回两个给定值的逻辑或 (||) 的倒数。
const nor = (a,b) => !(a || b);

调用方式:

nor(true, true); // false
nor(true, false); // false
nor(false, false); // true

应用场景

以下是一个实战示例:

结果如下:

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