Skip to content

Instantly share code, notes, and snippets.

@cimmwolf
Created May 7, 2016 05:19
Show Gist options
  • Save cimmwolf/ec533dc145fff6e968e64309106165a1 to your computer and use it in GitHub Desktop.
Save cimmwolf/ec533dc145fff6e968e64309106165a1 to your computer and use it in GitHub Desktop.
Возвращает множественную форму слова
function plural(n, forms) {
return forms[n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment