-
-
Notifications
You must be signed in to change notification settings - Fork 0
array iterator
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isArrayIterator<T>(it: unknown): it is ArrayIterator<T>;Check if the given value is an array iterator, which is an iterable iterator
that yields key-value pairs from an Array. This is the type of value that is
returned by Array.prototype.values and Array.prototype[Symbol.iterator].
| Name | Info |
|---|---|
it |
The value to check. |
true if the value is a array iterator, false otherwise.
Iterables
import { isArrayIterator } from "jsr:@nick/is/array-iterator";
const array = ["foo", "bar", "foo"];
const iter = array[Symbol.iterator]();
console.log(isArrayIterator(iterator)); // true
console.log(isArrayIterator(array)); // falseRepresents a array iterator.
-
T(default:unknown)
readonly [Symbol.toStringTag]: "Array Iterator";