Can someone fix this expression for some reason it’s not working
$currentEventValue == “open” || “active” ? “There is a device [red|$currentEventValue]” : “All devices are [green|SECURE]”
Problem with OR expressions
disforw
#1
ahndee
#2
Try
($currentEventValue == "open" || "active") ? "There is a device [red|$currentEventValue]" : "All devices are [green|SECURE]"
instead (operator precedence).
ady624
#4
|| is a logical operator (logical or), the result of “open” || “active” will give true. You need to use two comparisons with || in between them.
ahndee
#5
Oops - my bad. Here’s what should be correct:
(($currentEventValue == "open") || ($currentEventValue == "active")) ? "There is a device [red|$currentEventValue]" : "All devices are [green|SECURE]"