Skip to main content

$$xor

Evaluates to true if only one of the values provided will evaluate to true (using the Truthy logic)

Usage​

{ 
"$$xor": [ /* Values to check */ ]
}
"$$xor:{input}"

Returns​

boolean

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesValues to check

Examples​

Input

Definition

Output

[
true,
true,
false
]
"$$xor:$"
false
[
true,
false,
false
]
"$$xor:$"
true
[
null,
0
]
"$$xor:$"
false
[
1,
1
]
"$$xor:$"
false
[
1,
0
]
"$$xor:$"
true
[
1,
null
]
"$$xor:$"
true
[
2,
3
]
{
"$$xor": [
{
"$$is": "$[0]",
"eq": 2
},
{
"$$is": "$[1]",
"eq": 3
}
]
}
false
[
1,
3
]
{
"$$xor": [
{
"$$is": "$[0]",
"eq": 2
},
{
"$$is": "$[1]",
"eq": 3
}
]
}
true
[
2,
4
]
{
"$$xor": [
{
"$$is": "$[0]",
"eq": 2
},
{
"$$is": "$[1]",
"eq": 3
}
]
}
true
[
1,
4
]
{
"$$xor": [
{
"$$is": "$[0]",
"eq": 2
},
{
"$$is": "$[1]",
"eq": 3
}
]
}
false
[
1,
1
]
{
"$$xor": [
"$[0]",
"$[1]"
]
}
false
[
null,
null
]
{
"$$xor": [
"$[0]",
"$[1]"
]
}
false
[
null,
1
]
{
"$$xor": [
"$[0]",
"$[1]"
]
}
true