exports 和 module.exports 的区别[精简版]
 发布于 9 年前  作者 NextZeus  3367 次预览  最后一次回复是 9 年前  来自 分享 
  • exports 是指向的 module.exports 的引用

  • module.exports 初始值为一个空对象 {},所以 exports 初始值也是 {}

  • require() 返回的是 module.exports 而不是 exports

2 回复
hezhongfeng

其实大部分人,知道怎么使用就可以了~要知道为什么这么用的话就得知道这些了 对不?

NextZeus

@hezhongfeng 所以才叫精简版那 😄