0

In file second.js, I want to call a function A from first.js ? How to import ? I tried to import like import a module( export function in first.js) but it didnt work. Thanks

1 Answers1

0

If you are using a browser environment then you should include the scripts with the attribute type = "module"

Eg.

<script type="module" src="app.js"></script>
Winston Jude
  • 569
  • 2
  • 11