Created
April 20, 2015 21:39
-
-
Save ralt/47d8e0480ae2aa2e7310 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 month = require('C:/Users/Asus/Desktop/mod.js'); | |
console.log(month.toNum('January')); |
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
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