Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using "Exports." in Javascript?

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)?

like image 791
Novice coder Avatar asked Jun 08 '13 04:06

Novice coder


1 Answers

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...

like image 158
Software Engineer Avatar answered Oct 18 '22 05:10

Software Engineer