Ramda’s R.negate() takes a number and returns that number with the opposite sign. The official docs sample is a single call: R.negate(42) → -42. Added in v0.9.0.
Because it is a first-class function, you can drop it into pipelines instead of writing n => -n. Internally Ramda computes unary minus, so JavaScript’s -n rules apply — numeric strings coerce, and invalid values become NaN.
Syntax
Call R.negate. Start with this line.
Ramda
R.negate(n)
Call
What it does
R.negate(n)
Primary signature.
R.negate(...)
Call the math helper.
Prefer import { negate } from "ramda" when you want a named import.
Library declarations
Ramda
R.negate(n)
Parameters
Parameter
Description
n
Required. the value to negate. Ramda computes -n.
Return Value
Return Value
Description
*
Returns -n. For real numbers that is a Number with the opposite sign.
R.negate is implemented as -n. That is the same product as multiplying by -1 for ordinary numbers. Unlike R.inc("10"), which concatenates, R.negate("10") coerces the string first. Prefer real numbers anyway.
Example 4 — Flip an Object Field
R.evolve applies a function to a named property and returns a new object.
R.gt(R.__, 0) is “is this greater than zero?” If yes, run R.negate. If no, R.identity returns the value unchanged. That is a tidy way to force non-positive numbers without touching values that are already negative.
Compatibility
Browser Support
R.negate() is plain JavaScript unary minus — 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.negate()
Load Ramda via CDN or npm, then call R.negate(n). Because it only uses unary minus, 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.negate()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.negate(n) returns -n. It is Ramda's unary sign-flip helper — the functional equivalent of unary minus — so you can pass it to R.map, R.pipe, or R.evolve without writing a lambda.
R.negate(42) returns -42. That is the sample on ramdajs.com/docs/#negate. Added in v0.9.0.
Yes. It has arity 1 and is automatically curried. Call R.negate(42) for a number. Calling R.negate() with no argument returns a function that waits for n.
For real numbers they match: R.negate(42) and R.multiply(-1, 42) are both -42. R.negate is the dedicated unary helper, so it drops into R.map with no extra wrapping. R.multiply(-1) is a scaler you might reuse among other factors.
No. R.inc uses +, so R.inc("10") is "101". R.negate uses unary minus, which coerces: R.negate("10") is -10. Prefer real numbers anyway.
No. R.negate is a stable Ramda math helper from v0.9.0. It is not deprecated, experimental, or non-standard.