Use "Export". in javascript?

I am a new encoder and I am trying to interpret exports in the following code:

 exports.setCourse = function(c){ course = c; Ti.API.debug('Setting course to ' + course.get('title')); }; 

What is the difference between exports.setCourse=function(c) and just setCourse=function (c) ?

+6
source share
1 answer

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 provides for code outside of itself. It defines the interface of the module.

Check out fooobar.com/questions/100425 / ...

+9
source

Source: https://habr.com/ru/post/946832/


All Articles