7

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

2
  • Read here commonjs.org/specs/modules/1.0 Commented Jun 8, 2013 at 4:10
  • export keyword details here. Currently it is not supported natively by any of the web-browsers. Commented May 1, 2017 at 6:43

1 Answer 1

9

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.