Ramda.js R.isNotEmpty() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Logic

Definition

Ramda’s R.isNotEmpty() answers the flipped logic question: is this value not the empty leftover of its own type? You pass one value. You get back true or false. It is the named form of R.complement(R.isEmpty). Drop it into R.filter when you want filled leftovers to stay.

The official sample is the whole idea. [1, 2, 3] is not empty, so the leftover is true. [], '', and {} are empty, so the leftover is false. null is true — missing leftover is not empty leftover. Previous Logic helper is R.isEmpty. Next is R.not.

Syntax

Call R.isNotEmpty. Start with this line.

Ramda
R.isNotEmpty(x)
CallWhat it does
R.isNotEmpty(x)Primary signature.
R.isNotEmpty(...)Call the logic helper.

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

Library declarations
Ramda
R.isNotEmpty(x)

Parameters

ParameterDescription
xRequired. Any. The value to test. Lists, strings, objects, typed arrays, and other values are allowed.

Return Value

Return ValueDescription
Booleanfalse if x is its type's empty leftover. true otherwise, including for null and undefined.

Ramda Examples

📚 Getting Started

The official Ramda filled-list sample, then the same leftovers compared with isEmpty.

Example 1 — Official Filled List, Empty Leftovers, and null

A filled list is not empty. Empty list, string, or object is empty. null is not empty, so isNotEmpty is true.

Ramda
R.isNotEmpty([1, 2, 3]);
//=> true

R.isNotEmpty([]);
//=> false

R.isNotEmpty('');
//=> false

R.isNotEmpty(null);
//=> true

R.isNotEmpty({});
//=> false
Try It Yourself

How It Works

That is the docs sample from ramdajs.com. Empty leftovers of the same type are false. null has no empty leftover to match, so isNotEmpty is true.

Example 2 — vs isEmpty

Every leftover is the flip of isEmpty. 0 and false are not empty in these labs, so isNotEmpty is true.

Ramda
R.isNotEmpty('');
//=> false

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

R.isNotEmpty(null);
//=> true

R.isEmpty(null);
//=> false

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

R.isNotEmpty(false);
//=> true
Try It Yourself

How It Works

isNotEmpty is !isEmpty. In [email protected], 0 and false are not empty leftovers, so the named helper returns true.

📈 Practical Patterns

The official length-trap object, filtering filled leftovers, then an empty typed array versus complement.

Example 3 — { length: 0 } Is Not-Empty

A plain object with a length key is not an empty array, so isNotEmpty is true. A real empty list is false.

Ramda
R.isNotEmpty({ length: 0 });
//=> true

R.isNotEmpty([]);
//=> false

R.isNotEmpty({ a: 1 });
//=> true
Try It Yourself

How It Works

The docs include this leftover on purpose. { length: 0 } still has a key, so it is not {} and it is not [].

Example 4 — Filter Filled Leftovers

Keep leftovers that are not type-empty. Empty strings, lists, and objects drop out. null would stay, because it is not empty.

Ramda
const rows = ['ok', '', [], [1], {}];

R.filter(R.isNotEmpty, rows);
//=> ['ok', [1]]

R.reject(R.isNotEmpty, rows);
//=> ['', [], {}]
Try It Yourself

How It Works

R.isNotEmpty is already a predicate. filter keeps items that pass. reject keeps items that fail. Same leftover as R.reject(R.isEmpty, rows) for this list.

Example 5 — Empty Typed Array vs Complement

The official typed-array sample. An empty Uint8Array is empty, so isNotEmpty is false. Complement matches the named helper.

Ramda
R.isNotEmpty(Uint8Array.from(''));
//=> false

R.isNotEmpty(Uint8Array.from([1]));
//=> true

R.complement(R.isEmpty)([1, 2]);
//=> true
Try It Yourself

How It Works

That matches the docs Uint8Array.from('') sample. R.complement(R.isEmpty) is the handmade form of isNotEmpty.

Browser Support

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

✓ Ramda 0.29.2+ · Any JS runtime

Ramda.js R.isNotEmpty()

Load Ramda 0.29.2 or later via CDN or npm, then call R.isNotEmpty with one value. These labs use [email protected]. No extra browser API is required.

100% With Ramda 0.29.2+
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.isNotEmpty() Universal

Bottom line: Safe in any project that includes a Ramda build with isNotEmpty (official stamp v0.29.2; [email protected] in these labs). Use a CDN build such as ramda.min.js in the browser or install ramda from npm for Node.

Frequently Asked Questions

R.isNotEmpty(x) returns false if x is its type's empty value, otherwise true. It is the complement of R.isEmpty. Official docs stamp Added in v0.29.2. Type: a → Boolean. Arity 1, curried.
R.isNotEmpty([1, 2, 3]) is true. R.isNotEmpty([]) is false. R.isNotEmpty('') is false. R.isNotEmpty(null) is true. R.isNotEmpty({}) is false. R.isNotEmpty({ length: 0 }) is true. R.isNotEmpty(Uint8Array.from('')) is false.
Because R.isEmpty(null) is false. isNotEmpty is !isEmpty, so missing leftover is not empty leftover, and the named helper returns true. Use R.isNil when you mean null or undefined.
They are complements. Every leftover that isEmpty calls true, isNotEmpty calls false, and the other way around. Same types, flipped boolean.
Yes. That object has a length key, so it is not an empty array. R.isNotEmpty({ length: 0 }) is true. R.isNotEmpty([]) is false.
No. R.isNotEmpty is a stable Ramda logic helper. Official docs stamp v0.29.2. It is not deprecated, experimental, or non-standard. These labs load [email protected], which includes the helper.

Continue to R.not()

Learn how to flip a boolean leftover with Ramda R.not().

R.not() 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