textConvert
    Preparing search index...

    Function pluralize

    • Returns the plural form of an English word. Useful for UI copy like `${count} ${pluralize('item', count)}`.

      This is a documented, honest subset of English pluralization, not a complete linguistic solution — regular suffix rules (-s, -es, -ies) plus a maintained list of the most common irregulars and uncountable nouns. It does not cover every irregular (e.g. Greek-derived "-ch" words pronounced /k/ like "stomach" → "stomachs", not "stomaches"), or consonant-doubling irregulars (e.g. "quiz" → "quizzes", not "quizes").

      Parameters

      • word: string

        The singular word to pluralize.

      • Optionalcount: number

        If provided, returns word unchanged when count === 1; any other value (including 0, negative, or omitted) returns the plural form, matching standard English usage ("0 items", "1 item").

      Returns string

      The pluralized (or singular, if count === 1) form of word.

      pluralize('cat'); // 'cats'
      pluralize('cat', 1); // 'cat'
      pluralize('cat', 5); // 'cats'
      pluralize('child'); // 'children'
      pluralize('box'); // 'boxes'