【文件属性】:
文件名称:cycled:循环遍历数组的各项
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-01 07:27:25
npm-package cycle iterable array-helper JavaScript
循环的
循环遍历数组的各项
该程序包对于循环浏览选项卡,幻灯片图像等很有用。
安装
$ npm install cycled
用法
import Cycled from 'cycled' ;
const cycled = new Cycled ( [ 1 , 2 , 3 ] ) ;
cycled . current ( ) ;
//=> 1
cycled . next ( ) ;
//=> 2
cycled . next ( ) ;
//=> 3
cycled . next ( ) ;
//=> 1
cycled . previous ( ) ;
//=> 3
原料药
cycled = new Cycled(array)
使用下面介绍的方法启动数组子类。 由于它是一个数组,因此可以在其上使用所有常规数组方法。
大批
类型: Array
要包装的数组。
循环的
该实例是可迭代的,它将遍历
【文件预览】:
cycled-main
----index.js(907B)
----test.js(2KB)
----package.json(784B)
----index.test-d.ts(964B)
----readme.md(2KB)
----.github()
--------workflows()
----license(1KB)
----index.d.ts(2KB)
----.gitignore(23B)
----.npmrc(19B)
----.editorconfig(175B)
----.gitattributes(19B)