From 846c81022c6a3079466f3621c938d50199e7a8e8 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Tue, 5 Jul 2022 17:04:04 -0700 Subject: [PATCH] rename asIndexedPairs to indexed --- README.md | 6 +++--- spec.html | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 209d023..ecf8bae 100644 --- a/README.md +++ b/README.md @@ -133,9 +133,9 @@ result.next(); // {value: 4, done: false}; result.next(); // {value: 5, done: false}; ``` -### `.asIndexedPairs()` +### `.indexed()` -`.asIndexedPairs` takes no arguments. It returns an iterator where each value produced by the underlying iterator is paired with a counter, starting at 0 and increasing by 1 with every element produced. +`.indexed` takes no arguments. It returns an iterator where each value produced by the underlying iterator is paired with a counter, starting at 0 and increasing by 1 with every element produced. Returns an iterator of pairs. @@ -145,7 +145,7 @@ Returns an iterator of pairs. const abc = ["a", "b", "c"].values(); const result = abc - .asIndexedPairs(); + .indexed(); result.next(); // {value: [0, "a"], done: false}; result.next(); // {value: [1, "b"], done: false}; result.next(); // {value: [2, "c"], done: false}; diff --git a/spec.html b/spec.html index 157fca4..ffc8a5d 100644 --- a/spec.html +++ b/spec.html @@ -578,8 +578,8 @@

%Iterator.prototype%.drop ( _limit_ )

- -

%Iterator.prototype%.asIndexedPairs ( )

+ +

%Iterator.prototype%.indexed ( )

1. Let _iterated_ be ? GetIteratorDirect(*this* value). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and performs the following steps when called: @@ -823,8 +823,8 @@

%AsyncIterator.prototype%.drop ( _limit_ )

- -

%AsyncIterator.prototype%.asIndexedPairs ( )

+ +

%AsyncIterator.prototype%.indexed ( )

1. Let _iterated_ be ? GetIteratorDirect(*this* value). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and performs the following steps when called: