apportion:将数组或字符串分配到块中

时间:2021-04-16 17:37:30
【文件属性】:
文件名称:apportion:将数组或字符串分配到块中
文件大小:104KB
文件格式:ZIP
更新时间:2021-04-16 17:37:30
JavaScript 分摊 使用slice(...)方法和length字段将数组,字符串或任何其他值分配到请求大小的块中。 安装 使用安装: $ npm install --save apportion 用法 const apportion = require ( 'apportion' ) ; // apportion(indexable, blockSize, onlyComplete = false, overlapping = false) console . log ( apportion ( [ 1 , 2 , 3 , 4 , 5 ] , 2 ) ) ; // => [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ] console . log ( apportion ( [ 1 , 2 , 3 , 4 , 5 ] , 3 ) ) ; // => [
【文件预览】:
apportion-master
----package.json(796B)
----tests()
--------apportion.test.js(3KB)
----LICENSE(1KB)
----package-lock.json(198KB)
----src()
--------index.js(1KB)
----.npmignore(6B)
----.eslintrc.js(289B)
----.gitignore(914B)
----README.md(2KB)
----.eslintignore(5B)
----es5()
--------package.json(687B)
--------tests()
--------LICENSE(1KB)
--------package-lock.json(188KB)
--------src()
--------.eslintrc.js(488B)
--------.gitignore(15B)
--------README.md(2KB)

网友评论