JavaScript Iterator drop() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Instance method

Definition

iterator.drop(limit) skips the first limit values from the source, then returns a new lazy iterator that yields everything after that. If the source ends during the skip, the result is empty.

limit is a number: how many values to ignore at the front. Chain helpers as needed, then finish with toArray() or for...of to see what remains.

Remember
iterator.drop(limit)

limit 2        → skip the first 2 values
then           → yield the rest
returns        → a new lazy iterator

Pair with take() to keep a window
Collect with toArray() or for...of

Syntax

Call drop() on an iterator and pass how many values to skip from the start.

JavaScript
const it = [1, 2, 3, 4, 5].values();

const rest = it.drop(2);

console.log(rest.toArray());   // [3, 4, 5]
CallWhat it does
iterator.drop(limit)Skip the first limit values, then yield the rest.
iterator.drop(n).toArray()Drop the first n values into an array of what remains.
[1, 2, 3].values().drop(1)Start from an array iterator with .values().
iterator.drop(n).take(m)Skip n, then keep the next m values.

An Iterator helper (Baseline Newly available) on Iterator.prototype. No import required. Feature-detect before use in older engines. Siblings: Iterator.concat(), Iterator.from(), Iterator.zip(), Iterator.zipKeyed(), chunks(), every(), filter(), find(), flatMap(), forEach(), includes(), join(), map(), reduce(), some(), take(), toArray(), windows(), [Symbol.dispose](), [Symbol.iterator]().

Library declarations
JavaScript
// Iterator helpers (Baseline Newly available)
Iterator.prototype.drop(limit)

// limit   : number of values to skip from the start
// returns : a new lazy iterator helper

Parameters

ParameterDescription
limitRequired. A number saying how many values to skip. Use a non-negative integer such as 0, 1, or 2.

Return Value

Return ValueDescription
Iterator helperA new lazy iterator that starts after the skipped values. Use toArray() or for...of to consume what remains.

JavaScript Examples

Example 1 — Drop the First Two Values

Start with [1, 2, 3, 4, 5].values(), skip the first two, and collect the rest with toArray().

JavaScript
const nums = [1, 2, 3, 4, 5].values();
const rest = nums.drop(2);

console.log(rest.toArray());
Try It Yourself

The Try It page first checks that iterator.drop() exists, because Iterator helpers are still new. In an older browser it prints a short explanation and the output above. In a current browser it runs the code for real.

How It Works

  1. Start with five numbers. The iterator can yield 1 through 5.
  2. Skip two. drop(2) ignores 1 and 2.
  3. Collect the rest. toArray() prints [3, 4, 5].

Example 2 — Drop Then Take a Window

Skip the first two values, then keep only the next two. A small sliding-style window.

JavaScript
const result = [10, 20, 30, 40, 50].values()
  .drop(2)
  .take(2)
  .toArray();

console.log(result);
Try It Yourself

The Try It page first checks that iterator.drop() exists, because Iterator helpers are still new. In an older browser it prints a short explanation and the output above. In a current browser it runs the code for real.

How It Works

  1. Skip 10 and 20. After drop(2), the stream starts at 30.
  2. Keep two more. take(2) yields 30 and 40.
  3. Collect the window. toArray() shows [30, 40].

Example 3 — Drop Values from a Generator

Yield several words from a generator, drop the first one, and print the rest with for...of.

JavaScript
function* words() {
  yield "one";
  yield "two";
  yield "three";
}

const afterFirst = words().drop(1);

for (const w of afterFirst) {
  console.log(w);
}
Try It Yourself

The Try It page first checks that iterator.drop() exists, because Iterator helpers are still new. In an older browser it prints a short explanation and the output above. In a current browser it runs the code for real.

How It Works

  1. Yield three words. The generator produces "one", "two", and "three".
  2. Skip the first. drop(1) ignores "one".
  3. Print what remains. for...of shows two then three.

Browser & Runtime Support

Iterator.prototype.drop() is an Iterator helper (Baseline Newly available since March 2025). It works in current browsers and in Node.js 22 or newer.

✓ Baseline 2025 · Newly available

iterator.drop()

Supported in Chrome 122+, Edge 122+, Firefox 131+, Safari 18.4+, Opera 108+ and Node.js 22+. Internet Explorer never got it.

2025 Standard since
Google Chrome 122+ · Desktop & Mobile
Full support
Microsoft Edge 122+ · Chromium based
Full support
Mozilla Firefox 131+ · Desktop & Mobile
Full support
Apple Safari 18.4+ · macOS & iOS
Full support
Opera 108+ · Chromium based
Full support
Samsung Internet 26+ · Android
Supported
Android WebView 122+ · Chromium based
Supported
Node.js 22+ · Server runtime
Supported
Deno Recent versions · JavaScript runtime
Supported
Bun Recent versions · JavaScript runtime
Supported
Internet Explorer No native support
Not supported
iterator.drop() Current browsers

Bottom line: Check support with a typeof test before you use it in older browsers. Prefer chaining helpers and calling toArray() last.

Frequently Asked Questions

It returns a lazy iterator that skips the first limit values from the source, then yields everything that follows.
All values are skipped and the result is empty. You get [] from toArray(), not an error.
No. It returns another iterator helper. Use toArray() or for...of when you want the remaining values collected or printed.
drop(n) skips the first n values. take(n) keeps only the first n values and then stops.
Yes. drop(n).take(m) is a common way to keep a middle window of m values after skipping n.

Next: every()

Learn how to test whether every value from an iterator passes a check with every().

every() 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.

14 people found this page helpful