Returns an OperationFunction that yields elements from the source with their index.
Type of items in the source.
An OperationFunction that yields elements from the source with their index.
const result = withIndex<number>()([1, 2, 3]);console.log([...result]); // [[1, 0], [2, 1], [3, 2]] Copy
const result = withIndex<number>()([1, 2, 3]);console.log([...result]); // [[1, 0], [2, 1], [3, 2]]
Returns an OperationFunction that yields elements from the source with their index.