Primitive type representing a boolean value, true or
false.
Boolean values can be compared using the == and
!= operators.
Boolean values have the following logical operators:
Operation
Expression
AND
x && y
OR
x || y
NOT
!x
Rule evaluation will short-circuit on a boolean expression:
// Short-circuits at 'true' so someFunction() will never runtrue||someFunction()// Short-circuits at 'false' so someFunction() will never runfalse&&someFunction()// someFunction() will always runfalse||someFunction()
Strings can be converted into booleans using the bool()
function:
bool("true") == true
Was this helpful?
Recommended for you
About these recommendations
These recommendations help you find the content you are looking for. They may be based on the page you’re currently viewing and your account’s saved web and app activity.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-12-13 UTC."],[],[]]