How to simulate a NOR gate in JavaScript?

后端 未结 5 1302
滥情空心
滥情空心 2021-01-21 05:26

Does anyone know a way to simulate a NOR-gate in JavaScript?

https://en.wikipedia.org/wiki/NOR_gate

From what I have seen so far the language has only AND and OR

5条回答
  •  北海茫月
    2021-01-21 06:15

    This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate.

    if(!(a && b)) { // code }
    

提交回复
热议问题