HAP in scientist mode with lab equipment

Condition Builder

Station 2 Demo

Build compound conditions! Toggle the switches and adjust the slider to see how JavaScript evaluates &&, ||, and ! operators. Watch the short-circuit behavior in action!

Robot ID Card Controls

Compound Conditions

Watch how these expressions evaluate as you change the controls:

isOnline && energyLevel > 20
isOnline && energyLevel > 20
Result: true
Both conditions checked
!isOnline || energyLevel < 25
!isOnline || energyLevel < 25
Result: false
Both conditions checked
isOnline && !isCharging && energyLevel > 50
isOnline && !isCharging && energyLevel > 50
Result: true
All conditions checked
energyLevel > 0 || isCharging
energyLevel > 0 || isCharging
Result: true
Short-circuited at first condition!

Default Value Pattern

See how || returns the first truthy value:

Try: "hello", 42, 0, null, undefined, "", []

nickname || "HyBit A. ProtoBot"
displayName: "HyBit A. ProtoBot"
nickname is empty (falsy), so it returns the second value