|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
469 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Gets the number of `placeholder` occurrences in `array`.
|
|---|
| 3 | *
|
|---|
| 4 | * @private
|
|---|
| 5 | * @param {Array} array The array to inspect.
|
|---|
| 6 | * @param {*} placeholder The placeholder to search for.
|
|---|
| 7 | * @returns {number} Returns the placeholder count.
|
|---|
| 8 | */
|
|---|
| 9 | function countHolders(array, placeholder) {
|
|---|
| 10 | var length = array.length,
|
|---|
| 11 | result = 0;
|
|---|
| 12 |
|
|---|
| 13 | while (length--) {
|
|---|
| 14 | if (array[length] === placeholder) {
|
|---|
| 15 | ++result;
|
|---|
| 16 | }
|
|---|
| 17 | }
|
|---|
| 18 | return result;
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | module.exports = countHolders;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.