A Little Doubt about underscore Source Code

  node.js, question

There is such a paragraph in the source code:

if (typeof exports !== 'undefined') {
    if (typeof module !== 'undefined' && module.exports) {
      exports = module.exports = _;
    }
    exports._ = _; // 要么是exports._ = _,要么是module.exports = _
} else {
  root._ = _;
}

My question is whether exports and module.exports can use either one. won’t there be a circular reference problem between these two?

underscore

module.exportsAndexportsThe purpose of the is different, specifically if the output object is a whole object we usemodule.exports, or if it is a single export of attributes in an objectexports

//Global Export
 module.exports = {name:'wason',age:24,sex:'male'};
 //Single Export
 exports.name = 'wason';
 exports.age = 24;
 exports.sex = 'male';