Nocturnal Pajama Mutants
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

lei-cycle

1.0.0 • Public • Published

node-lei-cycle

循环返回指定数组中的一个元素

var createCycle = require('lei-cycle');
 
var c = createCycle(['h', 'e', 'l', 'l', 'o']);
// 也可以这样:  createCycle('h', 'e', 'l', 'l', 'o')
for (var i = 0; i < 10; i++) {
  console.log(c());
}

输出结果:

h
e
l
l
o
h
e
l
l
o

Keywords

install

npm i lei-cycle

Downloadsweekly downloads

4

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar