Standard built-ins

Iterator.prototype.drop()

Try the free JavaScript compiler

Lazily skips the specified number of initial values. The limit is converted to Number and then truncated to an integer (or Infinity); NaN or a negative resulting integer throws RangeError.

Formal Syntax & Structure

javascript syntaxjavascript
iterator.drop(limit)

Parameters & Attributes

NameTypeDescription
limitnumberNonnegative count; converted to integer or Infinity.

Return Value

Iterator

Result of the operation.

Working Example

Example Snippetjavascript
console.log(JSON.stringify(Iterator.from([1,2,3]).drop(2).toArray()));
JavaScript Reference