Question: what is the difference between require and import in js?
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.