File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ iterator.new(iterable)
2323 .find (... )
2424 .findIndex (... )
2525 .some (... )
26+ .includes (... )
2627 .intoArray ()
2728 .intoSet ()
2829 .intoMap ()
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export const Iterator = {
8787 } ,
8888
8989 /**
90- * Applies the lambda function to each item of the interable .
90+ * Applies the lambda function to each item of the iterable .
9191 *
9292 * @param {ForEachCallback } lambda
9393 */
@@ -197,7 +197,22 @@ export const Iterator = {
197197 } ,
198198
199199 /**
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.
201216 *
202217 * @param {number } [depth=1]
203218 *
You can’t perform that action at this time.
0 commit comments