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.
// 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
Parameter
Description
limit
Required. A number saying how many values to skip. Use a non-negative integer such as 0, 1, or 2.
Return Value
Return Value
Description
Iterator helper
A 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().
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
Start with five numbers. The iterator can yield 1 through 5.
Skip two.drop(2) ignores 1 and 2.
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.
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
Skip 10 and 20. After drop(2), the stream starts at 30.
Keep two more.take(2) yields 30 and 40.
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);
}
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
Yield three words. The generator produces "one", "two", and "three".
Skip the first.drop(1) ignores "one".
Print what remains.for...of shows two then three.
Compatibility
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.
2025Standard since
Google Chrome122+ · Desktop & Mobile
Full support
Microsoft Edge122+ · Chromium based
Full support
Mozilla Firefox131+ · Desktop & Mobile
Full support
Apple Safari18.4+ · macOS & iOS
Full support
Opera108+ · Chromium based
Full support
Samsung Internet26+ · Android
Supported
Android WebView122+ · Chromium based
Supported
Node.js22+ · Server runtime
Supported
DenoRecent versions · JavaScript runtime
Supported
BunRecent versions · JavaScript runtime
Supported
Internet ExplorerNo 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.