ES6 import/export vs module.exports

  javascript, jsx, node.js, reactjs

I want to use module.export in React and ES6 export/import in NodeJs.

I want to know what’s the difference them . Why can’t I use them interchangeably

I read someone’s answer that ES6 import, export is always compiled to CommonJS(require). If ES6 import is eventually converted to CommonJs, then why are we using it?

Source: Ask Javascript Questions

LEAVE A COMMENT