Files
lodash/_countHolders.js
John-David Dalton 65e5d998b3 Bump to v4.5.1.
2016-02-21 20:40:07 -08: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;
});