Files
lodash/_countHolders.js
John-David Dalton 0b9ddff408 Bump to v4.16.0.
2016-09-17 22:24:52 -07:00

25 lines
526 B
JavaScript

define([], function() {
/**
* 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) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
return countHolders;
});