Преглед на файлове

Docs: Improved docs in nth function.

Maciej Bukowski преди 8 години
родител
ревизия
80b0c5855f
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      packages/ckeditor5-utils/src/nth.js

+ 3 - 1
packages/ckeditor5-utils/src/nth.js

@@ -10,7 +10,9 @@
 /**
 /**
  * Returns `nth` (starts from `0` of course) item of the given `iterable`.
  * Returns `nth` (starts from `0` of course) item of the given `iterable`.
  * Consumes all items of the generator.
  * Consumes all items of the generator.
- * Consumes all items up to the index of the iterator, including the returned item.
+ * Consumes all items up to the index of the iterator that doesn't implement the `return()` method, (e.g. Array Iterator).
+ * It's necessary to implement the `return()` method to close the iterator after the return statement in the `nth` function is invoked.
+ * @see http://www.ecma-international.org/ecma-262/7.0/#sec-iteratorclose.
  *
  *
  * @param {Number} index
  * @param {Number} index
  * @param {Iterable.<*>} iterable
  * @param {Iterable.<*>} iterable