File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ iterator.new(iterable)
23
23
.find (... )
24
24
.findIndex (... )
25
25
.some (... )
26
+ .includes (... )
26
27
.intoArray ()
27
28
.intoSet ()
28
29
.intoMap ()
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export const Iterator = {
87
87
} ,
88
88
89
89
/**
90
- * Applies the lambda function to each item of the interable .
90
+ * Applies the lambda function to each item of the iterable .
91
91
*
92
92
* @param {ForEachCallback } lambda
93
93
*/
@@ -197,7 +197,22 @@ export const Iterator = {
197
197
} ,
198
198
199
199
/**
200
- * Flattens a nested interable structure for n depth.
200
+ * Determine if the given value is included in the iterable.
201
+ * Optionally specify a position at which to begin searching.
202
+ *
203
+ * @param {* } value
204
+ * @param {number } [fromIndex=0]
205
+ *
206
+ * @return {boolean }
207
+ */
208
+ includes ( value , fromIndex = 0 ) {
209
+ return ! ! this . find ( ( item , index ) => {
210
+ return item === value && index >= fromIndex ;
211
+ } ) ;
212
+ } ,
213
+
214
+ /**
215
+ * Flattens a nested iterable structure for n depth.
201
216
*
202
217
* @param {number } [depth=1]
203
218
*
You can’t perform that action at this time.
0 commit comments