Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
JavaScript
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Runtime system === A JavaScript engine must be embedded within a [[runtime system]] (such as a [[web browser]] or a standalone system) to enable scripts to interact with the broader environment. The runtime system includes the necessary APIs for [[input/output]] operations, such as [[computer network|networking]], [[data storage|storage]], and [[computer graphics|graphics]], and provides the ability to import scripts. JavaScript is a single-[[Thread (computing)|threaded]] language. The runtime processes [[Message (computer science)|messages]] from a [[Queue (abstract data type)|queue]] one at a time, and it calls a [[Subroutine|function]] associated with each new message, creating a [[call stack]] frame with the function's [[Parameter (computer programming)|arguments]] and [[local variable]]s. The call stack shrinks and grows based on the function's needs. When the call stack is empty upon function completion, JavaScript proceeds to the next message in the queue. This is called the [[event loop]], described as "run to completion" because each message is fully processed before the next message is considered. However, the language's [[Concurrency (computer science)|concurrency model]] describes the event loop as [[Asynchronous I/O|non-blocking]]: program I/O is performed using [[Event (computing)|events]] and [[Callback (computer programming)|callback functions]]. This means, for example, that JavaScript can process a mouse click while waiting for a database query to return information.<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop|title=Concurrency model and Event Loop|website=Mozilla Developer Network|access-date=August 28, 2015|archive-date=September 5, 2015|archive-url=https://web.archive.org/web/20150905045241/https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop|url-status=live}}</ref> The notable standalone runtimes are [[Node.js]], [[Deno (software)|Deno]], and [[Bun (software)|Bun]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)