Created
June 12, 2014 22:39
-
-
Save spamwax/75bdf810b2f067d46400 to your computer and use it in GitHub Desktop.
Solution to eloquentjavascript exercise second 2nd edition (Chapter 10) eloquent javascript
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
// Solution to eloquentjavascript exercise second 2nd edition | |
// Chapter 10 | |
//http://eloquentjavascript.net/2nd_edition/preview/10_modules.html | |
// Month names | |
var month = function() { | |
var names = ["Jan", "Feb", "March", "April", "May", "Junte", "July", "August", "September", "October", "November", "December"]; | |
return { | |
name: function(number) { return names[number];}, | |
number: function(name) {return names.indexOf(name);} | |
} | |
}(); | |
//--------------------------------------------------------------------- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sir, i have been struggling with the exercise 3 of this chapter, please can you help me out?