### chunk
将数组块划分为指定大小的较小数组。
使用`Array.from()`创建新的数组, 这符合将生成的区块数。使用`Array.slice()`将新数组的每个元素映射到`size`长度的区块。如果原始数组不能均匀拆分, 则最终的块将包含剩余的元素。
~~~js
const chunk = (arr, size) =>
Array.from({length: Math.ceil(arr.length / size)}, (v, i) => arr.slice(i * size, i * size + size));
// chunk([1,2,3,4,5], 2) -> [[1,2],[3,4],[5]]
~~~
- 数组类
- arrayMax
- arrayMin
- chunk
- compact
- countOccurrences
- deepFlatten
- difference
- distinctValuesOfArray
- dropElements
- everyNth
- filterNonUnique
- flatten
- flattenDepth
- groupby
- head
- initial
- initializeArrayWithRange
- initializeArrayWithValues
- intersection
- last
- mapObject
- nthElement
- pick
- pull
- remove
- sample
- shuffle
- similarity
- symmetricDifference
- tail
- take
- takeRight
- union
- without
- zip
- 浏览器
- bottomVisible
- currentURL
- elementIsVisibleInViewport
- getScrollPosition
- getURLParameters
- redirect
- scrollToTop
- 日期
- getDaysDiffBetweenDates
- JSONToDate
- toEnglishDate
- 函数类
- chainAsync
- compose
- curry
- functionName
- pipe
- promisify
- runPromisesInSeries
- sleep
- 数学
- arrayAverage
- arraySum
- collatz
- digitize
- distance
- factorial
- fibonacci
- gcd
- hammingDistance
- isDivisible
- iseven
- lcm
- median
- palindrome
- percentile
- powerset
- randomIntegerInRange
- randomNumberInRange
- round
- standardDeviation
- 媒体
- speechSynthesis
- 节点
- JSONToFile
- readFileLines
- 对象
- cleanObj
- objectFromPairs
- objectToPairs
- shallowClone
- truthCheckCollection
- 字符串
- anagrams
- Capitalize
- capitalizeEveryWord
- escapeRegExp
- fromCamelCase
- reverseString
- sortCharactersInString
- toCamelCase
- truncateString
- 实用
- coalesce
- coalesceFactory
- extendHex
- gettype
- hexToRGB
- isArray
- isBoolean
- isFunction
- isNumber
- isString
- isSymbol
- RGBToHex
- timeTaken
- toOrdinalSuffix
- UUIDGenerator
- validateEmail
- validateNumber
- copy
- clone
- throttle
- Shake
- isSupportTouch