Skip to content

Instantly share code, notes, and snippets.

@ralt
Created April 20, 2015 21:39
Show Gist options
  • Save ralt/47d8e0480ae2aa2e7310 to your computer and use it in GitHub Desktop.
Save ralt/47d8e0480ae2aa2e7310 to your computer and use it in GitHub Desktop.
var month = require('C:/Users/Asus/Desktop/mod.js');
console.log(month.toNum('January'));
function monthz () {
var months = ["January", "February", "March", "April"];
exports.toNum = function(name) {
return months.indexOf(name) + 1;
}
exports.toMon = function(num) {
return months[num];
}
}
monthz();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment