You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/iter/for-each/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ limitations under the License.
18
18
19
19
-->
20
20
21
-
# forEach Iterator
21
+
# iterForEach
22
22
23
23
> Create an iterator which invokes a function for each iterated value before returning the iterated value.
24
24
@@ -73,17 +73,17 @@ The returned iterator protocol-compliant object has the following properties:
73
73
-**next**: function which returns an iterator protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the iterator is finished.
74
74
-**return**: function which closes an iterator and returns a single (optional) argument in an iterator protocol-compliant object.
75
75
76
-
The invoked `function` is provided two arguments:
76
+
The invoked function is provided two arguments:
77
77
78
-
-`value`: iterated value
79
-
-`index`: iteration index (zero-based)
78
+
-**value**: iterated value
79
+
-**index**: iteration index (zero-based)
80
80
81
81
```javascript
82
82
var array2iterator =require( '@stdlib/array/to-iterator' );
83
83
84
-
functionassert( v ) {
85
-
if ( v !== v ) {
86
-
thrownewError( 'should not be NaN' );
84
+
functionassert( v, i ) {
85
+
if ( i <0 ) {
86
+
thrownewError( 'unexpected Error' );
87
87
}
88
88
}
89
89
@@ -102,7 +102,7 @@ r = it.next().value;
102
102
// ...
103
103
```
104
104
105
-
To set the function execution context, provide a `thisArg`.
105
+
To set the execution context for `fcn`, provide a `thisArg`.
106
106
107
107
```javascript
108
108
var array2iterator =require( '@stdlib/array/to-iterator' );
0 commit comments