Katana VentraIP

JavaScript

JavaScript (/ˈɑːvəskrɪpt/), often abbreviated as JS, is a programming language and core technology of the Web, alongside HTML and CSS. 99% of websites use JavaScript on the client side for webpage behavior.[10]

Not to be confused with Java (programming language), Javanese script, or ECMAScript.

Paradigm

Brendan Eich of Netscape initially; others have also contributed to the ECMAScript standard

December 4, 1995 (1995-12-04)[1]

ECMAScript 2023[2] Edit this on Wikidata / June 2023 (June 2023)
ECMAScript 2025[3] Edit this on Wikidata / 27 March 2024 (27 March 2024)

  • .js
  • .cjs
  • .mjs[4]

Web browsers have a dedicated JavaScript engine that executes the client code. These engines are also utilized in some servers and a variety of apps. The most popular runtime system for non-browser usage is Node.js.


JavaScript is a high-level, often just-in-time compiled language that conforms to the ECMAScript standard.[11] It has dynamic typing, prototype-based object-orientation, and first-class functions. It is multi-paradigm, supporting event-driven, functional, and imperative programming styles. It has application programming interfaces (APIs) for working with text, dates, regular expressions, standard data structures, and the Document Object Model (DOM).


The ECMAScript standard does not include any input/output (I/O), such as networking, storage, or graphics facilities. In practice, the web browser or other runtime system provides JavaScript APIs for I/O.


Although Java and JavaScript are similar in name, syntax, and respective standard libraries, the two languages are distinct and differ greatly in design.

History

Creation at Netscape

The first popular web browser with a graphical user interface, Mosaic, was released in 1993. Accessible to non-technical people, it played a prominent role in the rapid growth of the early World Wide Web.[12] The lead developers of Mosaic then founded the Netscape corporation, which released a more polished browser, Netscape Navigator, in 1994. This quickly became the most-used.[13]


During these formative years of the Web, web pages could only be static, lacking the capability for dynamic behavior after the page was loaded in the browser. There was a desire in the flourishing web development scene to remove this limitation, so in 1995, Netscape decided to add a programming language to Navigator. They pursued two routes to achieve this: collaborating with Sun Microsystems to embed the Java language, while also hiring Brendan Eich to embed the Scheme language.[6]


The goal was a "language for the masses",[14] "to help nonprogrammers create dynamic, interactive Web sites".[15] Netscape management soon decided that the best option was for Eich to devise a new language, with syntax similar to Java and less like Scheme or other extant scripting languages.[5][6] Although the new language and its interpreter implementation were called LiveScript when first shipped as part of a Navigator beta in September 1995, the name was changed to JavaScript for the official release in December.[6][1][16]


The choice of the JavaScript name has caused confusion, implying that it is directly related to Java. At the time, the dot-com boom had begun and Java was a popular new language, so Eich considered the JavaScript name a marketing ploy by Netscape.[14]

Adoption by Microsoft

Microsoft debuted Internet Explorer in 1995, leading to a browser war with Netscape. On the JavaScript front, Microsoft created its own interpreter called JScript.[17]


Microsoft first released JScript in 1996, alongside initial support for CSS and extensions to HTML. Each of these implementations was noticeably different from their counterparts in Netscape Navigator.[18][19] These differences made it difficult for developers to make their websites work well in both browsers, leading to widespread use of "best viewed in Netscape" and "best viewed in Internet Explorer" logos for several years.[18][20]

Trademark

"JavaScript" is a trademark of Oracle Corporation in the United States.[36][37] The trademark was originally issued to Sun Microsystems on 6 May 1997, and was transferred to Oracle when they acquired Sun in 2009.[38]

Loading new content without reloading the page, via Ajax or a WebSocket. For example, users of social media can send and receive messages without leaving the current page.

web page

Web page animations, such as fading objects in and out, resizing, and moving them.

Playing .

browser games

Controlling the of streaming media.

playback

Generating or alert boxes.

pop-up ads

input values of a web form before the data is sent to a web server.

Validating

Logging data about the user's behavior then sending it to a server. The website owner can use this data for , ad tracking, and personalization.

analytics

Redirecting a user to another page.

Storing and retrieving data on the user's device, via the or IndexedDB standards.

storage

Other usage

The use of JavaScript has expanded beyond its web browser roots. JavaScript engines are now embedded in a variety of other software systems, both for server-side website deployments and non-browser applications.


Initial attempts at promoting server-side JavaScript usage were Netscape Enterprise Server and Microsoft's Internet Information Services,[42][43] but they were small niches.[44] Server-side usage eventually started to grow in the late 2000s, with the creation of Node.js and other approaches.[44]


Electron, Cordova, React Native, and other application frameworks have been used to create many applications with behavior implemented in JavaScript. Other non-browser applications include Adobe Acrobat support for scripting PDF documents[45] and GNOME Shell extensions written in JavaScript.[46]


JavaScript has recently begun to appear in some embedded systems, usually by leveraging Node.js.[47][48][49]

The binary + operator casts both operands to a string unless both operands are numbers. This is because the addition operator doubles as a concatenation operator

The binary - operator always casts both operands to a number

Both unary operators (+, -) always cast the operand to a number

requiring an authentication token in the and GET parameters for any response that returns private information.

POST

Every major web browser has built-in , including a JavaScript debugger.

web development tools

tools, such as ESLint and JSLint, scan JavaScript code for conformance to a set of standards and guidelines.

Static program analysis

Some browsers have built-in . Stand-alone profiling libraries have also been created, such as benchmark.js and jsbench.[109][110]

profilers

Many have syntax highlighting support for JavaScript code.

text editors

Important tools have evolved with the language.

Related technologies

Java

A common misconception is that JavaScript is directly related to Java. Both indeed have a C-like syntax (the C language being their most immediate common ancestor language). They are also typically sandboxed, and JavaScript was designed with Java's syntax and standard library in mind. In particular, all Java keywords were reserved in original JavaScript, JavaScript's standard library follows Java's naming conventions, and JavaScript's Math and Date objects are based on classes from Java 1.0.[111]

Dere, Mohan (21 December 2017). . freeCodeCamp. Retrieved 14 June 2018.

"How to integrate create-react-app with all the libraries you need to make a great app"

Panchal, Krunal (26 April 2022). . Groovy Web. Retrieved 5 June 2023.

"Angular vs React Detailed Comparison"

Flanagan, David. JavaScript: The Definitive Guide. 7th edition. Sebastopol, California: O'Reilly, 2020.  978-1-491-95202-3.

ISBN

Haverbeke, Marijn. Eloquent JavaScript. 3rd edition. No Starch Press, 2018. 472 pages.  978-1593279509.(download)

ISBN

Zakas, Nicholas. Principles of Object-Oriented JavaScript, 1st edition. No Starch Press, 2014. 120 pages.  978-1593275402.

ISBN

. A community maintained continuously updated collection of tutorials on the entirety of the language.

The Modern JavaScript Tutorial

at Curlie

JavaScript

. Retrieved 6 February 2022.

"JavaScript: The First 20 Years"