### countOccurrences
計算數組中值的出現次數。
使用`Array.reduce()`在每次遇到數組中的特定值時遞增計數器。
~~~js
const countOccurrences = (arr, value) => arr.reduce((a, v) => v === value ? a + 1 : a + 0, 0);
// countOccurrences([1,1,2,1,2,3], 1) -> 3
~~~
- 數組類
- 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