How to include one JavaScript file inside another? Import and export of code
Hello everyone! I'm just starting to learn JavaScript and writing my first small project. I have a file `utils.js` where I store helper functions, for example, a function for formatting dates, and a main file `script.js` where I write the page logic.
The problem is that I don't know how to call a function declared in `utils.js` from `script.js`. I tried simply writing `` in HTML before `` — it works, but the code becomes messy, especially when there are many files. I feel like there should be a way to do this directly inside JavaScript, like in other languages (e.g., `#include` in C or `import` in Python).
Here's an example of my code:
**utils.js:**
```javascript
function formatDate(date) {
const options = { year: 'numeric'