not

not x

not(x)

Try it yourself:

See also:

Invert a Boolean condition with not

not(x) returns the logical opposite of x. It converts true to false and false to true, making exclusion conditions clear in formulas and filters.

Examples

Use not to retain values that do not meet a condition, often alongside filter. Combine it with and and or to build compound decisions. unequal is often clearer than negating an equality test.

Caveats

Be deliberate about truthiness and precedence: put compound conditions in parentheses before negating. Not is for logical values, not numeric complement; use unaryMinus to negate a number. Validate mixed user input with typeOf.

Try Not in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions