Avatar ·

How to include one JavaScript file inside another JavaScript file?

Hello everyone! I'm a beginner in JavaScript and I have a problem. I'm writing a small web application, and my code in one file script.js has become too large and messy. I decided to split it into several logical parts: for example, in the file utils.js I want to store helper functions, in the file api.js — work with the server, and in the main file app.js — the application logic. But I don't understand how to call a function declared in utils.js from app.js. I tried just writing several