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)
Call
What 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
Parameter
Description
a
Required. Any. Any value. Truthy leftovers become false. Falsy leftovers become true.
Return Value
Return Value
Description
Boolean
The 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.
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.
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.
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.
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.
Compatibility
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 ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll 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.