Last active
January 26, 2016 13:16
-
-
Save iptpv/19ccef6274d61ee70e1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var forms = ['вася', 'васи', 'васей']; | |
if (/1[1-4]$/.test(number)) { | |
return forms[2]; | |
} | |
if (/[2-4]$/.test(number)) { | |
return forms[1]; | |
} | |
if (/1$/.test(number)) { | |
return forms[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment