API Reference

Returns the letter or S or nothing at all based on the number passed. Good for pluralizing nouns.

function s(n: number): "" | "s"

// Example:

const appleCount = 4
const orangeCount = 1

console.log(`You have ${appleCount} apple${s(appleCount)}.`})
// => You have 4 apples.

console.log(`You have ${orangeCount} orange${s(orangeCount)}.`})
// => You have 1 orange.