Created
January 2, 2015 15:51
-
-
Save edele/113b36c27771bb1c3bf2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (function(exports) { | |
| var names = ["Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"]; | |
| exports.name = function(number) { | |
| return names[number]; | |
| }; | |
| exports.number = function(name) { | |
| return names.indexOf(name); | |
| }; | |
| })(this.weekDay = {}); | |
| console.log(weekDay.name(weekDay.number("Saturday"))); | |
| // → Saturday |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment