Package Exports
- listiterator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (listiterator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
listiterator API:
下载
npm install listiterator
引入模块
let Iterator = require("listiterator");
构造函数传入数组,创建迭代器
let it = new Iterator([1,2,3,4]);
获取下一个元素
it.next();
删除当前元素
it.remove();
是否存在下一个元素
it.hasNext();
判断是否存在上一个元素
it.hasPrevious();
逆向遍历,获取上一个元素
it.previous();
替换当前指针指向元素
it.set(value);
返回对 next 的后续调用所返回元素的索引
it.nextIndex();
关于作者:
email:admin@w3c.top