Skip to content

Instantly share code, notes, and snippets.

View denis23x's full-sized avatar
💭
I may be slow to respond.

Denis Iakimenko denis23x

💭
I may be slow to respond.
View GitHub Profile
@tomfun
tomfun / plural.js
Created August 23, 2016 12:31
JavaScript russian plural function
function getNoun(number, one, two, five) {
let n = Math.abs(number);
n %= 100;
if (n >= 5 && n <= 20) {
return five;
}
n %= 10;
if (n === 1) {
return one;
}