const pluralize Target Style export const pluralize = (num, { one, two, five }) => { Picks a pluralized string template using named forms. Target style API. Preferred for new code. Parametersnumnumberforms{ one: string, two: string, five: string } Returnsstring
const plural Legacy Style export const plural = (num, one, two, five) => pluralize(num, { one, two, five }) Picks a pluralized string template and injects the number into %. Legacy API. Kept for older code and not the preferred choice for new code. Parametersnumnumberonestringtwostringfivestring Returnsstring Exampleconst label = pluralize(3, { one: '% товар', two: '% товара', five: '% товаров', })