0

I have the values ​​lightsstasut1error, lightsstasut2error, lightsstasut3error and the strips contain either "Y" or "N". At this time, I want to return true if at least one of the values ​​is N, and false if all of them are Y. So I wrote the code, and if there is even one N, it keeps returning false. How do I fix my code?

this is my code

  const errors2 = (lightstasut1error || lightstasut2error || lightstasut3error) === "N" ? true : false;
user19476497
  • 495
  • 1
  • 10

1 Answers1

4

CHange this to this

const errors2 = (lightstasut1error === "N" || lightstasut2error === "N" || lightstasut3error === "N")

Please check now

Hope it helps, feel free for doubts

Gaurav Roy
  • 11,175
  • 3
  • 24
  • 45