Javascript Scripting Language
JavaScript, often abbreviated as JS, is a both (client-side but also server-side) scripting language that conforms to the ECMAScript specification.
Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web.
JavaScript is high-level, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.
License (various):
Mozilla SpiderMonkey uses MPL 2.0
V8 by Google uses BSD
Current (stable) version, supported by most of the web browsers: ES6
JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles.
This section is dedicated to the JavaScript language itself, and not the parts that are specific to Web pages or other host environments. For information about API specifics to Web pages, please see Web APIs and DOM.
The standard for JavaScript is ECMAScript. As of 2012, all modern browsers fully support ECMAScript 5.1. Older browsers support at least ECMAScript 3. On June 17, 2015, ECMA International published the sixth major version of ECMAScript, which is officially called ECMAScript 2015, and was initially referred to as ECMAScript 6
or ES6. Since then, ECMAScript standards are on yearly release cycles. This documentation refers to the latest draft version, which is currently ECMAScript 2020
.
Javascript is not Java. Do not confuse *JavaScript* with the *Java* programming language. The two programming languages have a very different syntax, semantic, and use.
Sample Code (Javascript Syntax)
// js
function helloWorld(runTest) {
var myString1 = 'Hello';
var myString2 = 'World';
var myNumber = 1;
var myTest = !! runTest; // force cast to bool
var myOutput = "Test was disabled ...";
if(myTest == true) {
myOutput = myString1 + ' ' + myString2 + ', this is number: ' + myNumber;
}
return myOutput;
}
var testResult = helloWorld(true);
console.log(testResult);
// #end js