A list helper that skips items from the start while a test returns true, then returns everything after — starting with the first item that fails. It works on arrays and strings and never changes the original. Part of Ramda List since v0.9.0 (stable — not deprecated, experimental, or non-standard).
Why not filter?R.reject removes matches everywhere. dropWhile only trims a leading run — perfect for headers, leading zeros, or already-finished items at the top of a list.
Syntax
Call R.dropWhile. Start with this line.
Ramda
R.dropWhile(pred, list)
Call
What it does
R.dropWhile(pred, list)
Primary signature.
R.dropWhile(...)
Call the list helper.
Prefer import { dropWhile } from "ramda" when you want a named import.
Library declarations
Ramda
R.dropWhile(pred, list)
Parameters
Parameter
Description
pred
Required. value → Boolean — truthy means "skip"
list
Required. An array or a string
Return Value
Return Value
Description
*
A new array (or string) from the first failing item to the end
Ramda Examples
Example 1 — Official Number Sample
Skip small numbers at the start, keep everything from the first big one.
takeWhile.R.takeWhile keeps the leading run: [1, 2].
dropWhile. Throws that same run away and keeps the rest: [3, 4, 3, 2, 1].
Two halves. Put together, takeWhile + dropWhile give back the original list.
reject.R.reject tests every item, so the trailing 2 and 1 are removed too: [3, 4, 3].
Compatibility
Browser & Runtime Support
R.dropWhile is a Ramda List helper since v0.9.0. It uses only indexing and slicing, so it runs anywhere Ramda runs — browsers via CDN or bundler, and Node.js / Bun / Deno with npm install ramda.
✓ Stable · Ramda 0.9.0+
R.dropWhile()
Support depends on the Ramda version you load, not on a browser feature. Your own test must also be valid in that runtime — e.g. arrow functions need an ES2015 engine.
100%Modern browsers & runtimes
Google ChromeModern versions · Desktop & Mobile
Full support
Mozilla FirefoxModern versions · Desktop & Mobile
Full support
Apple SafariModern versions · macOS & iOS
Full support
Microsoft EdgeChromium-based
Full support
OperaModern versions
Full support
Samsung InternetModern versions · Android
Full support
Android WebViewModern WebView
Full support
Internet ExplorerNot a target for current Ramda releases
Legacy
Node.jsMaintained LTS · npm install ramda
Supported
Bunimport from "ramda"
Supported
Denoimport from "npm:ramda"
Supported
R.dropWhileRamda 0.9.0+
Bottom line: Safe for production in any modern browser or JavaScript runtime once Ramda is loaded. The labs on this page use [email protected] from a CDN.
Frequently Asked Questions
R.dropWhile(pred, list) skips items from the start while pred returns true, then returns everything from the first failing item onward. The docs sample is R.dropWhile(x => x <= 2, [1, 2, 3, 4, 3, 2, 1]) //=> [3, 4, 3, 2, 1].
No. It stops at the first item that fails the test and keeps the rest unchanged. In [1, 2, 3, 4, 3, 2, 1], the 2 and 1 at the end stay. To remove every match, use R.reject.
Yes. A string in gives a string out: R.dropWhile(x => x !== 'd', 'Ramda') //=> 'da'. The predicate receives one character at a time.
takeWhile keeps the leading run that dropWhile throws away, so the two split a list in two. dropLastWhile does the same skipping, but from the end of the list.
No. Ramda passes only the value. If you need the index, wrap it: R.addIndex(R.dropWhile)((x, i) => i < 2, list).
No. R.dropWhile has been part of Ramda since v0.9.0 and is stable — not deprecated, experimental, or non-standard.