Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/aitertools/src/range.ts>Range#[Symbol.iterator]

Well-tested utility functions dealing with async iterables
Latest
method Range.prototype.[Symbol.iterator]
import { Range } from "https://deno.land/x/aitertools@0.6.0/src/range.ts";

Iterates over the elements of the range.

import { range } from "./range.ts";

for (const value of range(4n)) console.log(value);

The above example will print the following 4 lines:

0
1
2
3

Returns

Iterator<T>

An iterator that iterates over the elements of the range.