Ramda.js R.not() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Logic

Definition

Ramda’s R.not() answers a logic question: what is the boolean inverse of this value? You pass one leftover. You get back true or false. Native JavaScript would write !a. R.not names that flip so you can drop it into R.map, R.filter, and R.pipe without a lambda that only wraps !.

The official sample is the whole idea. R.not(true) is false. R.not(false) is true. R.not(0) is true because 0 is falsy. R.not(1) is false because 1 is truthy. Need to flip a function, not a value? That is R.complement. Previous Logic helper is R.isNotEmpty. Next is R.or.

Syntax

Call R.not. Start with this line.

Ramda
R.not(a)
CallWhat it does
R.not(a)Primary signature.
R.not(...)Call the logic helper.

Prefer import { not } from "ramda" when you want a named import.

Library declarations
Ramda
R.not(a)

Parameters

ParameterDescription
aRequired. Any. Any value. Truthy leftovers become false. Falsy leftovers become true.

Return Value

Return ValueDescription
BooleanThe logical inverse of a. Always true or false — never the original leftover.

Ramda Examples

📚 Getting Started

The official Ramda boolean table, then the same leftover compared with ! and complement.

Example 1 — Official Boolean Table

Truthy leftovers become false. Falsy leftovers become true. That is the whole helper.

Ramda
R.not(true);
//=> false

R.not(false);
//=> true

R.not(0);
//=> true

R.not(1);
//=> false
Try It Yourself

How It Works

true and 1 are truthy, so the leftover is false. false and 0 are falsy, so the leftover is true. That is the docs sample from ramdajs.com.

Example 2 — vs ! and complement

The operator matches the leftover. complement wraps a function first, then applies the same flip.

Ramda
R.not(true);
//=> false

!true;
//=> false

R.complement(R.identity)(true);
//=> false

R.not(R.isNil(null));
//=> false
Try It Yourself

How It Works

R.not(true) and !true agree. R.complement(R.identity) is the same flip after identity returns the value. R.not(R.isNil(null)) first runs the test, then flips the boolean — that is a value flip, not a function wrapper.

📈 Practical Patterns

Empty arrays stay truthy, then map and filter, then a pipe that matches complement.

Example 3 — Truthy Traps

Empty arrays and empty objects are still truthy. Empty strings and zeros are not.

Ramda
R.not([]);
//=> false

R.not({});
//=> false

R.not('');
//=> true

R.not(null);
//=> true
Try It Yourself

How It Works

JavaScript treats [] and {} as truthy, so logical not is false. Need “is this empty?” That is R.isEmpty, not R.not. Need “is this missing?” That is R.isNil.

Example 4 — Map and Filter

Pass R.not as a first-class leftover. Map flips every flag. Filter keeps the falsy leftovers.

Ramda
R.map(R.not, [true, false, 0, 1]);
//=> [false, true, true, false]

R.filter(R.not, [true, false, 0, 1]);
//=> [false, 0]
Try It Yourself

How It Works

R.map applies the flip to every item. R.filter keeps items whose leftover is truthy after the flip, so false and 0 stay. Native ! cannot sit in that first argument without a wrapper lambda.

Example 5 — Pipe vs Complement

Flip a function leftover by composing not after the test. That is the handmade form of complement.

Ramda
const isNotNil = R.pipe(R.isNil, R.not);

isNotNil(null);
//=> false

isNotNil(7);
//=> true

R.complement(R.isNil)(7);
//=> true
Try It Yourself

How It Works

R.isNil(null) is true, then not flips it to false. Prefer R.complement when you want that leftover named as one helper. Prefer R.not when the leftover is already a value.

Browser Support

R.not() is ordinary JavaScript once Ramda is loaded. Logos use the shared browser-image-sprite.png sprite from this project.

✓ Ramda 0.1.0+ · Any JS runtime

Ramda.js R.not()

Load Ramda 0.1.0 or later via CDN or npm, then call R.not with a value. No extra browser API is required.

100% With Ramda 0.1.0+
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
R.not() Universal

Bottom line: Safe in any project that includes Ramda 0.1.0 or later. Use a CDN build such as ramda.min.js in the browser or install ramda from npm for Node. These labs use [email protected].

Frequently Asked Questions

R.not(a) returns the logical inverse of a. Truthy values become false. Falsy values become true. The leftover is always a boolean. Added in v0.1.0. Type: * → Boolean. Arity 1, curried.
R.not(true) is false. R.not(false) is true. R.not(0) is true. R.not(1) is false.
not flips a value: R.not(true) is false. complement flips a function: R.complement(R.isNil) is a new predicate you can pass to filter. R.pipe(R.isNil, R.not) is the same idea as R.complement(R.isNil).
Yes for the leftover. R.not(x) matches !x as a boolean. The difference is that R.not is a first-class function you can drop into R.map, R.filter, and R.pipe.
Empty arrays and empty objects are truthy in JavaScript. Logical not of a truthy leftover is false. Falsy leftovers are false, 0, -0, 0n, '', null, undefined, and NaN.
No. R.not is a stable Ramda logic helper from v0.1.0. It is not deprecated, experimental, or non-standard.

Continue to R.or()

Learn how to combine two leftovers with logical OR using Ramda R.or().

R.or() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful