Files
lodash/.internal/countHolders.js
John-David Dalton 6cb3460fce Remove semicolons.
2017-02-05 22:22:04 -08:00

22 lines
462 B
JavaScript

/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
let length = array.length
let result = 0
while (length--) {
if (array[length] === placeholder) {
++result
}
}
return result
}
export default countHolders