HalbeegThe open encyclopediaAf-Soomaali
ArticleTalkReadView history

JavaScript

From Halbeeg, the open encyclopedia · Af-Soomaali

118 languages
JavaScript bat-smg
JavaScript be-x-old
JavaScript simple
爪哇手稿語 zh-classical
JavaScript zh-min-nan
JavaScript zh-yue
JavaScript
JavaScript code to display a list of weekdays in a browserLionel Rowe · CC0 · Commons

JavaScript is a programming language originally designed for use on web pages. It is one of three core technologies of the web: HTML (the structure of a page), CSS (the presentation), and JavaScript (the behaviour and interaction). All modern browsers contain an engine that executes JavaScript code.

Initially JavaScript ran only in browsers used by people, but it now powers server applications, embedded systems, and mobile and desktop programs. It is conventionally described as an interpreted language — the code is not wholly translated beforehand, but is executed when called, although modern engines employ a technique called JIT compilation to improve performance.

Brief history

JavaScript was created by Brendan Eich while he worked at Netscape in 1995. It was given various names at first (Mocha, then LiveScript) before becoming known as JavaScript. The name reflected the marketing of the Java language, though the two languages are distinct in structure and fundamentals.

To maintain consistency among browsers, the language was standardized at international level under the name ECMAScript. The 2015 edition (ECMAScript 2015, also known as ES6) brought major changes including `let` and `const`, classes, modules, and arrow functions. Thereafter a practice of releasing a new version each year was adopted.

Language features

JavaScript is a dynamically typed language — data types are not declared beforehand, but determined at runtime. It supports multiple programming paradigms: object-oriented programming based on prototypes, functional programming in which functions are treated as values that can be passed around, and procedural programming. Functions are first-class, meaning they can be passed as arguments to other functions.

One key feature is asynchronous execution — a program can continue while awaiting a result (for example, data fetched over a network). This is managed through callbacks, Promises, and the `async`/`await` keywords. The engine uses an event loop mechanism to process pending operations on a single thread.

Ecosystems and tools

Node.js is a runtime that made it possible to write JavaScript for servers; it is built on V8, the engine used by Google Chrome. Other browsers have their own engines, such as SpiderMonkey (Firefox) and JavaScriptCore (Safari). The npm package system provides access to many shared libraries.

Popular frameworks and libraries for building user interfaces include React, Angular, and Vue. TypeScript is also widely used; it is a language built on JavaScript that adds static typing and is translated to JavaScript before execution.

NoteJavaScript and Java are two distinct languages. The similarity in their names does not reflect a close technical relationship.
Categories:411 words · 0 sources