admin管理员组

文章数量:1288078

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

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

Share Improve this question edited Sep 25, 2014 at 20:40 Software Engineer 16.1k8 gold badges84 silver badges107 bronze badges asked Jun 8, 2013 at 4:01 Novice coderNovice coder 792 silver badges7 bronze badges 2
  • Read here monjs/specs/modules/1.0 – elclanrs Commented Jun 8, 2013 at 4:10
  • export keyword details here. Currently it is not supported natively by any of the web-browsers. – RBT Commented May 1, 2017 at 6:43
Add a ment  | 

1 Answer 1

Reset to default 9

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

本文标签: functionUsing quotExportsquot in JavascriptStack Overflow