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 0daedcf..598d08c 100644 --- a/spec.html +++ b/spec.html @@ -579,8 +579,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: @@ -824,8 +824,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: