Last active
March 4, 2017 20:40
-
-
Save KennethanCeyer/d4848af11711a3ab3f65653449b32c43 to your computer and use it in GitHub Desktop.
Node.js module definition
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
var math = require('./math'); | |
console.log(math.sum(1, 2)); |
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
module.exports = { | |
sum: function() { | |
var total = 0; | |
for (var idx in arguments) { | |
total += arguments[idx]; | |
} | |
return total; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment