Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_countHolders.js 469B

123456789101112131415161718192021
  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. while (length--) {
  13. if (array[length] === placeholder) {
  14. ++result;
  15. }
  16. }
  17. return result;
  18. }
  19. module.exports = countHolders;