Ramda.js R.drop() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
List

Definition

R.drop(n, list) returns a new list or string with the first n items removed (official Ramda docs). The original value is never changed, and asking for more items than exist simply gives an empty result.

Stable since v0.1.0: R.drop is not deprecated, experimental, or non-standard. Note: a negative n drops nothing — unlike native slice(-1), it does not count from the end.

Syntax

Call R.drop. Start with this line.

Ramda
R.drop(n, list) or R.drop(n)(list)
CallWhat it does
R.drop(n, list) or R.drop(n)(list)Primary signature.
R.drop(...)Call the list helper.

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

Library declarations
Ramda
R.drop(n, list) or R.drop(n)(list)

Parameters

ParameterDescription
nRequired. How many items to skip; 0 or negative skips nothing
listOptional. Array or string; omit it to get a reusable function

Return Value

Return ValueDescription
*A new array or string of the remaining items

Ramda Examples

Example 1 — Official Samples

Skip 1, 2, 3, and 4 items from a list, then 3 characters from a string — straight from the Ramda docs.

Ramda
const words = ['foo', 'bar', 'baz'];

console.log(R.drop(1, words));     // ['bar', 'baz']
console.log(R.drop(2, words));     // ['baz']
console.log(R.drop(3, words));     // []
console.log(R.drop(4, words));     // []
console.log(R.drop(3, 'ramda'));   // 'da'
Try It Yourself

How It Works

  1. Skip from the start. R.drop(1, words) removes 'foo' and keeps the rest.
  2. Bigger n. Dropping 2 leaves only 'baz'; dropping 3 removes everything.
  3. Past the end. Dropping 4 from a 3-item list is not an error — you just get [].
  4. Strings. A string returns a string: skipping 'ram' leaves 'da'.

Example 2 — Skip a Header Row

Give R.drop only n to build a reusable helper, and see that the original list stays intact.

Ramda
const rows = ['name,age', 'Ana,34', 'Ben,17'];

const skipHeader = R.drop(1);

console.log(skipHeader(rows));   // ['Ana,34', 'Ben,17']
console.log(rows);               // ['name,age', 'Ana,34', 'Ben,17']
Try It Yourself

How It Works

  1. Curried. R.drop(1) has no list yet, so it returns a function that waits for one.
  2. Named helper. skipHeader reads like plain English and can be reused for any table.
  3. New copy. Calling it returns a new array without the first row.
  4. No mutation. Logging rows again shows all three rows — unlike rows.shift().

Example 3 — Paginate with drop and take

Skip the earlier pages with R.drop, then keep one page with R.take.

Ramda
const items = [1, 2, 3, 4, 5, 6, 7, 8];

const getPage = (page, size) =>
  R.pipe(R.drop((page - 1) * size), R.take(size));

console.log(getPage(1, 3)(items));  // [1, 2, 3]
console.log(getPage(2, 3)(items));  // [4, 5, 6]
console.log(getPage(3, 3)(items));  // [7, 8]
Try It Yourself

How It Works

  1. Items to skip. Page 2 with size 3 skips (2 - 1) * 3 = 3 items.
  2. Drop. R.drop(3) turns the list into [4, 5, 6, 7, 8].
  3. Take. R.take(3) keeps the first three: [4, 5, 6].
  4. Last page. Page 3 has only two items left, so R.take(3) safely returns [7, 8].

Example 4 — Zero, Negative, and Too-Large n

R.drop never throws for an odd n; it clamps it to the list instead.

Ramda
const nums = [1, 2, 3];

console.log(R.drop(0, nums));    // [1, 2, 3]
console.log(R.drop(-2, nums));   // [1, 2, 3]
console.log(R.drop(10, nums));   // []
console.log(R.drop(2, []));      // []
Try It Yourself

How It Works

  1. Zero. Skipping nothing returns a new copy with every item.
  2. Negative. Ramda uses Math.max(0, n), so -2 becomes 0 — it does not count from the end.
  3. Too large. Skipping 10 from 3 items leaves nothing: [].
  4. Empty list. There is nothing to skip, so the result is another empty array.

Example 5 — drop vs dropLast vs tail

Three ways to remove items — from the start, from the end, or exactly one.

Ramda
const nums = [1, 2, 3, 4, 5];

console.log(R.drop(2, nums));       // [3, 4, 5]
console.log(R.dropLast(2, nums));   // [1, 2, 3]
console.log(R.tail(nums));          // [2, 3, 4, 5]
Try It Yourself

How It Works

  1. drop. Removes the first two items, 1 and 2.
  2. dropLast. R.dropLast removes the last two, 4 and 5.
  3. tail. R.tail always removes exactly one item from the start — the same as R.drop(1).
  4. All new. Each call returns a fresh array; nums is still [1, 2, 3, 4, 5].

Browser & Runtime Support

R.drop() is plain JavaScript inside Ramda 0.1.0+. It copies with native slice (ES3) for arrays and strings, so it works wherever Ramda loads.

✓ Ramda 0.1.0+ · Any JS runtime

Ramda.js R.drop()

The UMD build (ramda.min.js) is compiled to ES5 syntax, so it runs in Chrome, Firefox, Safari, and Edge. Via npm it works in Node.js, Deno, and Bun with require or import.

100% With Ramda loaded
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
R.drop() Universal

Bottom line: Safe in any project that includes Ramda. Load ramda.min.js from a CDN in the browser, or npm install ramda for Node, Deno, and Bun. These labs load [email protected].

Frequently Asked Questions

R.drop(n, list) returns a new list without the first n items. It also works on strings. The official samples are R.drop(1, ['foo', 'bar', 'baz']), which returns ['bar', 'baz'], and R.drop(3, 'ramda'), which returns 'da'.
You get an empty result: [] for arrays and '' for strings. It is not an error, and the original list is never changed.
It drops nothing and returns a full copy, because Ramda uses Math.max(0, n). This differs from native slice, where list.slice(-1) returns the last item.
R.take(n, list) keeps the first n items, R.drop(n, list) removes them, and R.dropLast(n, list) removes n items from the end instead. R.take(n) and R.drop(n) together split a list in two, like R.splitAt(n).
R.tail(list) always removes exactly one item, so it equals R.drop(1, list). R.drop lets you choose how many items to skip.
No. R.drop has been a stable Ramda list function since v0.1.0. It is not deprecated, experimental, or non-standard.

Next: R.dropLast()

Skip the last n items of a list or string.

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