30 seconds of codeBack to Home
Returns the singular or plural form of the word based on the input number. If the first argument is an
object, it will use a closure by returning a function that can auto-pluralize words that don't simply end in
s if the supplied dictionary contains the word.
num is either
1, return the singular form of the word. If
num is any other number, return the plural form. Omit the third argument to use the default of the singular word +
s, or supply a custom pluralized word when necessary. If the first argument is an
object, utilize a closure by returning a function which can use the supplied dictionary to resolve the correct plural form of the word.