Ramda.js R.propIs() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Type

Definition

Ramda’s R.propIs() answers a yes/no question: does this property on an object match that constructor? You pass a constructor, a property name string, then an object. You get back a Boolean. Under the hood Ramda reads obj[name] and calls R.is — so R.propIs(Number, 'x', obj) is the same idea as R.is(Number, obj.x). It is not value equality: that is Relation cousin R.propEq, which uses R.equals. It is not a custom predicate: that is Logic cousin R.propSatisfies. Need a constructor on a bare value? That is Type cousin R.is. Need a string tag? That is Type cousin R.type. Missing, null, or undefined at the property name all fail the constructor check. Previous helper is R.isNotNil. Next is R.type.

The official sample is the whole idea. {x: 1, y: 2} passes for Number at 'x'. {x: 'foo'} and {} fail. Previous helper is R.isNotNil. Next is R.type.

Syntax

Call R.propIs. Start with this line.

Ramda
R.propIs(type, name, obj)
CallWhat it does
R.propIs(type, name, obj)Primary signature.
R.propIs(...)Call the type helper.

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

Library declarations
Ramda
R.propIs(type, name, obj)

Parameters

ParameterDescription
typeRequired. Constructor. The constructor to test against, such as Number, String, or Array.
nameRequired. String. The property name on obj to read and test.
objRequired. Object. The object whose property is checked.

Return Value

Return ValueDescription
Booleantrue if the property at name on obj is an instance of type (via R.is), otherwise false.

Ramda Examples

📚 Getting Started

The official Ramda samples in one snippet, then the same check written with R.is manually.

Example 1 — Official Samples

Every docs line in one list. Constructor, property name, object in — Boolean back.

Ramda
R.propIs(Number, 'x', { x: 1, y: 2 });
//=> true

R.propIs(Number, 'x', { x: 'foo' });
//=> false

R.propIs(Number, 'x', {});
//=> false
Try It Yourself

How It Works

That is the docs sample from ramdajs.com. Ramda reads obj.x and runs R.is(Number, value). Example 2 writes the same check by hand.

Example 2 — vs R.is(Number, obj.x)

propIs is a packaged read + is. Same Boolean for the same object.

Ramda
const obj = { x: 1, y: 2 };

R.propIs(Number, 'x', obj);
//=> true

R.is(Number, obj.x);
//=> true
Try It Yourself

How It Works

Two calls, same leftover. propIs names the property read once. Example 3 then splits constructor checks from value equality.

📈 Practical Patterns

propEq vs propIs, missing properties, then a curried filter on object rows.

Example 3 — vs R.propEq

propEq uses R.equals. propIs uses constructor membership via R.is.

Ramda
const obj = { x: 1 };

R.propEq(1, 'x', obj);
//=> true

R.propIs(Number, 'x', obj);
//=> true

R.propEq('1', 'x', obj);
//=> false

R.propIs(Number, 'x', obj);
//=> true
Try It Yourself

How It Works

Both pass for Number 1. Only propIs still passes when the value is a number but propEq wanted the string '1'. Pick propEq for exact value match; pick propIs for constructor shape.

Example 4 — Missing or Wrong Property

Absent x, wrong type at x, or empty object — all false.

Ramda
R.propIs(Number, 'x', {});
//=> false

R.propIs(Number, 'x', { x: 'foo' });
//=> false

R.propIs(Number, 'x', { y: 1 });
//=> false
Try It Yourself

How It Works

Missing x reads as undefined, which fails every constructor. A string at x fails Number. Example 5 curries the leftover for a list of objects.

Example 5 — Curried leftover with R.filter

Two-arg partial: const isNumX = R.propIs(Number, 'x'), then filter object rows.

Ramda
const isNumX = R.propIs(Number, 'x');

R.filter(isNumX, [{ x: 1 }, { x: 'a' }, { x: 2 }]);
//=> [{ x: 1 }, { x: 2 }]
Try It Yourself

How It Works

R.propIs(Number, 'x') waits for the object. filter keeps rows whose x is a Number. Same idea as list.filter(obj => R.is(Number, obj.x)).

Browser Support

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

✓ Ramda 0.16.0+ · Any JS runtime

Ramda.js R.propIs()

Load Ramda 0.16.0 or later via CDN or npm, then call R.propIs with constructor, name, and object. No extra browser API is required.

100% With Ramda 0.16.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.propIs() Universal

Bottom line: Safe in any project that includes Ramda 0.16.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], which includes the helper.

Frequently Asked Questions

R.propIs(type, name, obj) returns true when the property at name on obj is an instance of type, using R.is internally. Type: Type → String → Object → Boolean. Parameters: type (constructor), name (property name string), obj (object). Returns Boolean. Arity 3, curried. Added in v0.16.0.
R.propIs(Number, 'x', {x: 1, y: 2}) is true. R.propIs(Number, 'x', {x: 'foo'}) is false. R.propIs(Number, 'x', {}) is false.
R.is(ctor, val) tests a value directly. R.propIs(ctor, name, obj) reads obj[name] and runs the same constructor check. propIs(Number, 'x', obj) is the same idea as R.is(Number, obj.x).
propEq checks value equality via R.equals. propIs checks constructor membership via R.is. R.propEq(1, 'x', {x: 1}) is true, and so is R.propIs(Number, 'x', {x: 1}). R.propEq('1', 'x', {x: 1}) is false while the number 1 still passes propIs. In [email protected] the order is value first: R.propEq(val, name, obj).
R.propIs(Number, 'x', {}) is false because undefined is not a Number. A string at x is also false. Missing, null, undefined, or wrong constructor all fail.
No. R.propIs is a stable Ramda Type helper from v0.16.0. It is not deprecated, experimental, or non-standard.

Continue to R.type()

Learn how to name the native kind of a value as a single-word string with Ramda R.type().

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