toggleSwitch.isOpen

Category:Circuit Playground

Determines if the switch has been flipped on or off.

toggleSwitch.isOpen() is a boolean property. It returns true if the switch is flipped on, otherwise it returns false. The switch has a little plus and minus side by it to help you remember which side is which.

Syntax

toggleSwitch.isOpen

Returns

Boolean

Tips

Found a bug in the documentation? Let us know at documentation@code.org