Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spamwax/75bdf810b2f067d46400 to your computer and use it in GitHub Desktop.
Save spamwax/75bdf810b2f067d46400 to your computer and use it in GitHub Desktop.
Solution to eloquentjavascript exercise second 2nd edition (Chapter 10) eloquent javascript
// 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);}
}
}();
//---------------------------------------------------------------------
@IAMOTZ
Copy link

IAMOTZ commented Apr 13, 2017

sir, i have been struggling with the exercise 3 of this chapter, please can you help me out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment