I'm a new coder and I'm trying to interpret exports
in the following code:
exports.setCourse = function(c){
course = c;
Ti.API.debug('Setting course to ' + course.get('title'));
};
Whats the difference between exports.setCourse=function(c)
and just setCourse=function (c)
?
and welcome to the wonderful world of coding -- I hope you enjoy it.
exports
is a node.js concept that declares the functions that your module makes available to code outside itself. It defines the module's interface.
Check out this StackOverflow answer...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With