A runtime is the environment in which a program or script is executed. It provides the necessary resources and context for the program to run, including memory management, input/output operations, and system calls.
Wherever an application is run, this environment is required to run it in a particular programming language. If the proper environment/runtime for that language doesn’t exist, that application will not run.
For JavaScript, the runtime includes the JavaScript engine, which executes the code, and other components like the event loop and APIs that handle tasks such as HTTP requests or file operations.