Ramda’s R.inc() takes a number and returns that number plus one. The official docs sample is a single call: R.inc(42) → 43. Added in v0.9.0. See also R.dec.
Because it is a first-class function, you can drop it into pipelines instead of writing n => n + 1. Internally Ramda computes n + 1, so JavaScript’s addition rules apply — numeric strings can concatenate, and invalid values become NaN.
Syntax
Call R.inc. Start with this line.
Ramda
R.inc(n)
Call
What it does
R.inc(n)
Primary signature.
R.inc(...)
Call the math helper.
Prefer import { inc } from "ramda" when you want a named import.
Library declarations
Ramda
R.inc(n)
Parameters
Parameter
Description
n
Required. the value to increment. Ramda computes n + 1.
R.inc is implemented as n + 1, so a numeric string concatenates. R.add calls Number() on both arguments, which is why R.add(1, "10") is 11. Pass real numbers to R.inc when you can.
Example 4 — Increment an Object Field
R.evolve applies a function to a named property and returns a new object.
R.has("count") chooses the branch. If the key exists, R.over runs R.inc on that property. If it does not, R.assoc creates count: 1. That is the official ifElse sample built around R.inc.
Compatibility
Browser Support
R.inc() is plain JavaScript addition — it runs anywhere Ramda loads: every modern browser plus Node.js. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Ramda 0.9.0+ · Any JS runtime
Ramda.js R.inc()
Load Ramda via CDN or npm, then call R.inc(n). Because it only uses n + 1, behavior is identical across engines.
100%With Ramda loaded
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.inc()Universal
Bottom line: Safe in any project that includes Ramda. Use a CDN build such as ramda.min.js in the browser or install ramda from npm for Node.
Frequently Asked Questions
R.inc(n) returns n + 1. It is Ramda's unary increment helper — the functional equivalent of adding one — so you can pass it to R.map, R.pipe, or R.evolve without writing a lambda.
R.inc(42) returns 43. That is the sample on ramdajs.com/docs/#inc. Added in v0.9.0. See also R.dec.
Yes. It has arity 1 and is automatically curried. Call R.inc(42) for a number. Calling R.inc() with no argument returns a function that waits for n.
R.inc(n) is n + 1. R.dec(n) is n - 1. Addition with + can concatenate (R.inc('10') is '101'). Subtraction coerces numeric strings to numbers (R.dec('10') is 9). Prefer real numbers, or use R.add(1, n) when you need Number() coercion.
R.add(a, b) is a curried binary helper that wraps both arguments in Number() before adding. R.inc(n) is always plus one and uses the + operator, so R.inc('10') concatenates while R.add(1, '10') returns 11.
No. R.inc is a stable Ramda math helper from v0.9.0. It is not deprecated, experimental, or non-standard.