Question: what is the difference between import and require in javascript?
Answer: The major difference between require and import , is that require will automatically scan node_modules to find modules, but import , which comes from ES6, won't. ... js' notes, import won't support node_modules , it base on ES6, and must specify the path of the module.