JavaScript: Difference between revisions

From WikiMD's Wellness Encyclopedia

CSV import
CSV import
 
Line 47: Line 47:
{{computer-programming-stub}}
{{computer-programming-stub}}
{{No image}}
{{No image}}
__NOINDEX__

Latest revision as of 15:33, 17 March 2025


JavaScript (often abbreviated as JS) is a high-level, interpreted programming language that conforms to the ECMAScript specification. JavaScript has become one of the core technologies of the World Wide Web, alongside HTML and CSS, as it enables interactive web pages and is thus an essential part of web applications. The vast majority of websites use JavaScript, and all major web browsers have a dedicated JavaScript engine to execute it.

History[edit]

JavaScript was created in 1995 by Brendan Eich while he was an engineer at Netscape. Originally developed under the name Mocha, the language was later renamed to LiveScript, and finally to JavaScript, coinciding with the release of Netscape Navigator 2.0. Despite the name, JavaScript is almost entirely unrelated to the Java programming language, and the common naming is generally considered a marketing ploy by Netscape to capitalize on Java's popularity at the time.

Features[edit]

JavaScript is characterized by its dynamic typing, prototype-based object-orientation, and first-class functions. It is a multi-paradigm language, supporting imperative, event-driven, and functional programming styles.

Syntax and semantics[edit]

JavaScript's syntax is influenced by that of C, though it has fewer low-level facilities. JavaScript supports object-oriented programming with object prototypes, instead of classes (as in C++ or Java). However, with the introduction of ES6 (ECMAScript 2015), JavaScript now supports class-based object-oriented programming as well.

Runtime environment[edit]

JavaScript typically runs in a client-side environment (e.g., in a web browser), but it can also be used on the server-side, through environments such as Node.js. This dual capability allows for the development of full-fledged applications that are capable of interacting with a web server and a database.

Usage[edit]

JavaScript is used in many aspects of web development. It is used to provide dynamic behavior on websites (e.g., interactive forms, pop-ups, animations), to load content asynchronously via AJAX calls, and to build complex user interfaces with frameworks like React, Angular, and Vue.js.

Security[edit]

JavaScript can also be a vector for web security issues, particularly through cross-site scripting (XSS) attacks, where malicious scripts are injected into trusted websites. Modern development practices and frameworks strive to mitigate these risks through various techniques, including content security policies and sandboxing.

See also[edit]

References[edit]

<references/>



Stub icon
   This article is a computer programming stub. You can help WikiMD by expanding it!