mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
21
.internal/countHolders.js
Normal file
21
.internal/countHolders.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 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;
|
||||
Reference in New Issue
Block a user