You are on page 1of 145

JavaScript

JavaScript (/ˈdʒɑːvəˌskrɪpt/[6]), often
abbreviated as JS, is a high-level,
dynamic, weakly typed, prototype-based,
multi-paradigm, and interpreted
programming language. Alongside HTML
and CSS, JavaScript is one of the three
core technologies of World Wide Web
content production. It is used to make
webpages interactive and provide online
programs, including video games. The
majority of websites employ it, and all

modern web browsers support it without
the need for plug-ins by means of a built-
in JavaScript engine. Each of the many
JavaScript engines represent a different
implementation of JavaScript, all based
on the ECMAScript specification, with
some engines not supporting the spec
fully, and with many engines supporting
additional features beyond ECMA.

JavaScript
Paradigm Multi-paradigm: object-oriented
(prototype-based), imperative,
functional, event-driven[1]

Designed by Brendan Eich

Developer Netscape Communications
Corporation, Mozilla
Foundation, Ecma International

First appeared December 4, 1995[2]

Stable release ECMAScript 2017[3] /
June 2017

Typing dynamic, duck
discipline

Filename .js
extensions

Website Mozilla

Major implementations

Java. LiveScript. AtScript. Scheme. Self. JScript . C. Dart.NET. Opa. Python. V8. QML. AWK. Perl 6. Objective-J. Perl. SpiderMonkey. TypeScript JavaScript at Wikibooks . CoffeeScript. JavaScriptCore. Chakra Influenced by Lua. HyperTalk Influenced ActionScript.

JavaScript Filename . dates. but the language itself does not . arrays.javascript-source Identifier (UTI) [5] Type of Scripting language format As a multi-paradigm language. JavaScript supports event-driven.netscape. functional. It has an API for working with text. and imperative (including object-oriented and prototype-based) programming styles. and basic manipulation of the DOM.js extension Internet application/javascript media type text/javascript  (obsolete) Uniform Type com. regular expressions.

Although there are strong outward similarities between JavaScript and Java. including server-side in web servers and databases.include any I/O. storage. JavaScript engines are now embedded in many other types of host software. relying for these upon the host environment in which it is embedded. Initially only implemented client-side in web browsers. including desktop widgets. . and in non- web programs such as word processors and PDF software. or graphics facilities. such as networking. and in runtime environments that make JavaScript available for writing mobile and desktop applications.

[7] History Beginnings at Netscape In 1993. the two languages are distinct and differ greatly in design. JavaScript was influenced by programming languages such as Self and Scheme. a unit of the University of Illinois at Urbana- Champaign. released NCSA Mosaic. and respective standard libraries.including language name. syntax. which played an important part in . the National Center for Supercomputing Applications (NCSA). the first popular graphical Web browser.

it intentionally shared no code with NCSA Mosaic. The internal codename for the company's browser was Mozilla. Mosaic Netscape 0. as the company's goal was to displace NCSA Mosaic as the world's number one web browser. In 1994. However. The first version of the Web browser. which stood for "Mosaic killer".9. Within four months it had already taken three-quarters of the browser market and . a company called Mosaic Communications was founded in Mountain View.expanding the growth of the nascent World Wide Web. California and employed many of the original NCSA Mosaic authors to create Mosaic Netscape. was released in late 1994.

became the main browser for the Internet in the 1990s. the founder of the company believed that HTML needed a "glue language" that was easy to use by Web designers and part-time programmers to assemble components such as images and plugins. . and the company took the name Netscape Communications. To avoid trademark ownership problems with the NCSA. the browser was subsequently renamed Netscape Navigator in the same year. Netscape Communications realized that the Web needed to become more dynamic. where the code could be written directly in the Web page markup. Marc Andreessen.

Netscape Communications collaborated with Sun Microsystems to include in Netscape Navigator Sun's more static programming language Java. Python. Netscape Communications recruited Brendan Eich with the goal of embedding the Scheme programming language into its Netscape Navigator. or . TCL. which excluded adopting other languages such as Perl.In 1995.[8] Before he could get started. in order to compete with Microsoft for user adoption of Web technologies and platforms.[9] Netscape Communications then decided that the scripting language they wanted to create would complement Java and should have a similar syntax.

0 beta 3 in December.[10] The final choice of name caused confusion. the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2. and the choice has been characterized as a . Although it was developed under the name Mocha. giving the impression that the language was a spin-off of the Java programming language.0 in September 1995. the company needed a prototype.Scheme. Eich wrote one in 10 days. in May 1995. but it was renamed JavaScript[2] when it was deployed in the Netscape Navigator 2. To defend the idea of JavaScript against competing proposals.

[11][12] Brendan Eich. had never heard of C-.created in 1997).(not to be confused with the later C-. though Web page scripting was not a new concept.[13] Nombas did pitch their embedded Web page scripting to Netscape.[14] Nombas later switched to offering JavaScript . There is a common misconception that JavaScript was influenced by an earlier Web page scripting language developed by Nombas named C-. however.before he created LiveScript.marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new Web programming language. as shown by the ViolaWWW Web browser.

in their ScriptEase product and was part of the TC39 group that standardized ECMAScript.instead of C-.js in 2009. soon after releasing JavaScript for browsers. such as Node.[16] Since the mid-2000s.[17] Adoption by Microsoft . additional server- side JavaScript implementations have been introduced. Netscape introduced an implementation of the language for server-side scripting with Netscape Enterprise Server.[15] Server-side JavaScript In December 1995.

[18][19] These differences made it difficult for designers and programmers to make a single website work well in both browsers. was part of Internet Explorer 3. JScript. a reverse-engineered implementation of Netscape's JavaScript. but in each case the implementation was noticeably different to that found in Netscape Navigator at the time.Microsoft script technologies including VBScript and JScript were released in 1996. Internet Explorer 3 also included Microsoft's first support for CSS and various extensions to HTML. . JScript was also available for server- side scripting in Internet Information Server.

[20] JavaScript began to acquire a reputation for being one of the roadblocks to a cross-platform and standards-driven Web. but many could not afford the time.leading to the use of "best viewed in Netscape" and "best viewed in Internet Explorer" logos that characterized these early years of the browser wars. Microsoft introduced the concept of Dynamic HTML. but the differences in language implementations and the different and proprietary Document Object Models remained and were obstacles to .[18] With the release of Internet Explorer 4. Some developers took on the difficult task of trying to make their sites work in both major browsers.

This led to the official release of the language specification ECMAScript published in the first edition of the ECMA-262 standard in June 1997. which other browser vendors could then implement based on the work done at Netscape. Netscape submitted JavaScript to Ecma International to carve out a standard specification.[18] Standardization In November 1996. ActionScript and .widespread take-up of JavaScript on the Web. with JavaScript being the most well known of the implementations.

JScript are other well-known implementations of ECMAScript. The original ECMAScript 4 work led by Waldemar Horwat (then at Netscape. now at Google) started in 2000 and at first. with the release of ECMAScript 2 in June 1998. The standards process continued in cycles.NET language. which brings some modifications to conform to the ISO/IEC 16262 international standard. The release of ECMAScript 3 followed in December 1999. Microsoft seemed to participate and even implemented some of the proposals in their JScript . which is the baseline for modern day JavaScript. .

So by 2003. even though they had no competing proposal and they had a partial (and diverged at this point) implementation on the . the ECMA- 357 standard. The next major event was in 2005. the original ECMAScript 4 work was mothballed. which came from ex- . Brendan Eich and Mozilla rejoined Ecma International as a not-for- profit member and work started on ECMAScript for XML (E4X). First. with two major happenings in JavaScript's history.Over time it was clear though that Microsoft had no intention of cooperating or implementing proper JavaScript in Internet Explorer.NET server side.

To this end. as an open source project. But Tamarin and ActionScript 3 were too different .Microsoft employees at BEA Systems (originally acquired as Crossgain). who were implementing E4X in ActionScript 3 (ActionScript 3 was a fork of original ECMAScript 4). Adobe Systems released the ActionScript Virtual Machine 2. So. work restarted on ECMAScript 4 with the goal of standardizing what was in ActionScript 3. along with Macromedia. This led to working jointly with Macromedia (later acquired by Adobe Systems). code named Tamarin.

The development of ECMAScript 4 was never completed. there was still turmoil between the various players. Alas. Douglas Crockford—then at Yahoo!—joined forces with Microsoft in 2007 to oppose ECMAScript 4. as was realized by the parties in 2007 and 2008.[21] While all of this was happening. but that work influenced subsequent versions.1 effort.from web JavaScript to converge. This community effort was sparked in 2005 when Jesse James Garrett released a white paper in which . the open source and developer communities set to work to revolutionize what could be done with JavaScript. which led to the ECMAScript 3.

and described a set of technologies. This resulted in a renaissance period of JavaScript usage spearheaded by open source libraries and the communities that formed around them. In July 2008. of which JavaScript was the backbone. MooTools. This led to the eventual agreement in early . used to create web applications where data can be loaded in the background. jQuery.he coined the term Ajax. avoiding the need for full page reloads and leading to more dynamic applications. and others being released. Dojo Toolkit. the disparate parties on either side came together in Oslo. with libraries such as Prototype.

1 to ECMAScript 5 and drive the language forward using an agenda that is known as Harmony. released in June 2017. ECMAScript 2016 was released in June 2016. The current version is ECMAScript 2017. ECMAScript 2015 was released in June 2015.[22] Later developments . ECMAScript 5.1 was released to fully align with the third edition of the ISO/IEC 16262 international standard.2009 to rename ECMAScript 3. In June 2011. ECMAScript 5 was finally released in December 2009.

The result was a proliferation of comprehensive frameworks and libraries.[23] The advent of Ajax returned JavaScript to the spotlight and brought more professional programming attention. as seen by the proliferation of server-side JavaScript platforms. and increased usage of JavaScript outside Web browsers.JavaScript has become one of the most popular programming languages on the Web. many professional programmers denigrated the language because. improved JavaScript programming practices. its target audience consisted of Web authors and other such "amateurs". among other reasons. . however. Initially.

In January 2009. the CommonJS project was founded with the goal of specifying a common standard library mainly for JavaScript development outside the browser. it is increasingly being used as a compile target for source-to-source compilers from both dynamic languages and static languages.[24] With the rise of single-page applications and JavaScript-heavy sites.[25] It is used under license for technology . Trademark "JavaScript" is a trademark of Oracle Corporation in the United States.

Scripts written in Vanilla JS are plain JavaScript code.[26] Vanilla JavaScript The terms Vanilla JavaScript and Vanilla JS refer to JavaScript not extended by any frameworks or additional libraries. unless explicitly specified otherwise. .invented and implemented by Netscape Communications and current entities such as the Mozilla Foundation. Features The following features are common to all conforming ECMAScript implementations.

Universal support All modern Web browsers support JavaScript with built-in interpreters. Like C.g.).. etc. if statements. while loops. JavaScript makes . do while loops. Imperative and structured JavaScript supports much of the structured programming syntax from C (e. meaning JavaScript now has both function and block scoping. ECMAScript 2015 added keywords let and const for block scoping. switch statements. One partial exception is scoping: JavaScript originally had only function scoping with var.

[27] Dynamic Typing As with most scripting languages. JavaScript is dynamically typed. a variable that is at one time bound to a number may later be re- bound to a string. which allows the semicolons that would normally terminate statements to be omitted. For example. rather than just with each expression. a type is associated with each value.[28] JavaScript .a distinction between expressions and statements. One syntactic difference from C is automatic semicolon insertion.

each string key provides the name for an object property. including duck typing. supports various ways to test the type of an object. In JavaScript. an object is an associative array. augmented with a prototype (see below).x = 10) and bracket notation . and there are two syntactical ways to specify such a name: dot notation (obj.[29] Run-time evaluation JavaScript includes an eval function that can execute statements provided as strings at run-time. Prototype-based (object- oriented) JavaScript is almost entirely object- based.

including Function and Date.[31] Functions as object constructors . rebound.. JavaScript has a small number of built-in objects.. A property may be added. or deleted at run-time.[30] It is possible to simulate many class-based features with prototypes in JavaScript. Prototypes JavaScript uses prototypes where many other object-oriented languages use classes for inheritance.in loop. Most properties of an object (and any property that belongs to an object's prototype inheritance chain) can be enumerated using a for.(obj['x'] = 10).

Prefixing a function call with new will create an instance of a prototype.Functions double as object constructors.[33] The constructor's prototype property determines the object used for the new object's internal prototype. inheriting properties and methods from the constructor (including properties from the Object prototype). along with their typical role. New methods can be added by modifying .[32] ECMAScript 5 offers the Object. allowing explicit creation of an instance without automatically inheriting from the Object prototype (older environments can assign the prototype to null).create method.

it is generally considered bad practice because most objects in JavaScript will inherit methods and properties from the Object prototype. also have prototypes that can be modified. and they may not expect the prototype to be modified. While it is possible to modify the Object prototype. JavaScript's built-in constructors.[34] Functions as methods Unlike many object-oriented languages.the prototype of the function used as a constructor. Rather. there is no distinction between a function definition and a method definition. the distinction occurs during function . such as Array or Object.

each nested function forms a lexical closure: The lexical scope of the outer function (including any constant. such as . a function may have properties and methods. As such. In addition.[35] A nested function is a function defined within another function. It is created each time the outer function is invoked. a function is considered to be an object. when a function is called as a method of an object.bind(). the function's local this keyword is bound to that object for that invocation. calling. local variable.call() and . Functional A function is first-class. or .

argument value) becomes part of the internal state of each inner function object. Functions as roles (Traits and Mixins) JavaScript natively supports various function-based implementations of Role[37] patterns like Traits[38][39] and Mixins.[36] JavaScript also supports anonymous functions. even after execution of the outer function concludes. Delegative JavaScript supports implicit and explicit delegation.[40] Such a function defines additional behavior by at least one method bound to the this keyword .

Once the method is found it gets called within this object's context..g. implicit delegation already happens every time the prototype chain is walked in order to. find a method that might be related to but is not directly owned by an object.within its function body. A Role then has to be delegated explicitly via call or apply to objects that need to feature additional behavior that is not shared via the prototype chain. Object composition and inheritance Whereas explicit function-based delegation does cover composition in JavaScript. Thus inheritance in JavaScript is covered by a delegation automatism that is bound . e.

g. HTML <script> elements). a Web browser) to provide objects and methods by which scripts can interact with the environment (e.. Miscellaneous Run-time environment JavaScript typically relies on a run-time environment (e.g. This is not a language feature per se. It also relies on the run-time environment to provide the ability to include/import scripts (e. but it is common in most JavaScript implementations. ...g. to the prototype property of constructor functions. a webpage DOM).

This is called the event loop. JavaScript calls a function associated with that message. Upon function completion. the language's concurrency model describes the . when the stack is empty. which creates a call stack frame (the function's arguments and local variables). JavaScript proceeds to the next message in the queue. The call stack shrinks and grows based on the function's needs.JavaScript processes messages from a queue one at a time. However. Upon loading a new message. described as "run to completion" because each message is fully processed before the next message is considered.

The function can access them through formal parameters and also through the local arguments object. that JavaScript can process a mouse click while waiting for a database query to return information. This means. for instance.event loop as non-blocking: program input/output is performed using events and callback functions. Array and object literals . Variadic functions can also be created by using the bind method.[41] Variadic functions An indefinite number of parameters can be passed to a function.

Like many scripting languages. and new language .[42] Vendor-specific extensions JavaScript is officially managed by Mozilla Foundation. which provide a concise and powerful syntax for text manipulation that is more sophisticated than the built-in string functions. In fact. these literals form the basis of the JSON data format. arrays and objects (associative arrays in other languages) can each be created with a succinct shortcut syntax. Regular expressions JavaScript also supports regular expressions in a manner similar to Perl.

Gecko. only some JavaScript engines support these new features: property getter and setter functions (supported by WebKit.[43] ActionScript.features are added periodically. and Rhino)[44] conditional catch clauses iterator protocol (adopted from Python) shallow generators-coroutines (adopted from Python) array comprehensions and generator expressions (adopted from Python) proper block scope via the let keyword . However. Opera.

array and object destructuring (limited form of pattern matching) concise function expressions (function(args) expr) ECMAScript for XML (E4X). an extension that adds native XML support to ECMAScript (unsupported in Firefox since version 21[45]) Syntax Simple examples Variables in JavaScript can be defined using the var keyword:[46] .

var x; // defines the
variable x and assigns to
it the special value
"undefined" (not to be
confused with an undefined
value)
var y = 2; // defines the
variable y and assigns to
it the value 2
var z = "Hello, World!"; //
defines the variable z and
assigns to it a string
entitled "Hello, World!"

Note the comments in the example
above, both of which were preceded with

two forward slashes.

There is no built-in I/O functionality in
JavaScript; the run-time environment
provides that. The ECMAScript
specification in edition 5.1 mentions:[47]

… indeed, there are no
provisions in this specification
for input of external data or
output of computed results.

However, most runtime environments
have a console object[48] that can be
used to print output. Here is a minimalist
Hello World program in JavaScript:

console.log("Hello
World!");

A simple recursive function:

function factorial(n) {
if (n === 0 || n === 1)
{
return 1; // 0! =
1! = 1
}
return n * factorial(n
- 1);
}

factorial(3); // returns 6

closure(). // returns 1 closure(). }. // returns 3 This example shows that.An anonymous function (or lambda): function counter() { var count = 0. in JavaScript. function closures capture their non-local . return function() { return ++count. // returns 2 closure(). } var closure = counter().

In JavaScript. objects are created in the same way as functions. this. .variables by reference. this is known as a function object.area = pi*r**2. Object example: function Ball(r) { this.radius = r.show = function(){ //objects can contain functions drawCircle(r). //the radius variable is local to the ball object this.

//references a circle drawing function } } myBall = new Ball(5). //this instance of the ball object has the show function performed on it Variadic function demonstration (arguments is a special variable):[49] .show(). //creates a new instance of the ball object with radius 5 myBall.

// returns 6 Immediately-invoked function expressions are often used to create modules. i < arguments.length. 3). Modules allow gathering . } sum(1. 2. ++i) { x += arguments[i]. for (var i = 0. function sum() { var x = 0. // returns 3 sum(1. } return x. as before ECMAScript 2015 there was not built-in construct in the language. 2).

}. set: function (value) { i = value. . }.properties and methods in a namespace and making some of them private: var counter = (function () { var i = 0. // private property return { // public methods get: function () { alert(i).

})(). // module counter.increment(). // shows 8 More advanced example . increment: function () { alert(++i). // shows 0 counter. // shows 7 counter. } }.increment(). counter.set(6).get().

y) { // constructor function var checkInt = function(x) { // inner function if (x % 1 !== 0) { throw new TypeError(x + "is not an integer").This sample code displays various JavaScript features. /* Finds the lowest common multiple (LCM) of two numbers */ function LCMCalculator(x. . // var a = mouseX }.

b = checkInt(y).prototype = { // object literal .a = checkInt(x) // semicolons ^^^^ are optional. a newline is enough this. return x } this. LCMCalculator. } // The prototype of object instances created by a constructor is // that constructor's "prototype" property.

a).abs(this. constructor: LCMCalculator.abs(this. b = a. b = Math. . t. set the constructor property appropriately gcd: function() { // method that calculates the greatest common divisor // Euclidean algorithm: var a = Math.b). // when reassigning a prototype. if (a < b) { // swap variables t = b.

} while (b !== 0) { t = b. } // Only need to calculate GCD once. a = t. a = t.gcd refers to this "redefinition" instead of LCMCalculator.gcd . // so that this. b = a % b. // (Actually not redefinition—it's defined on the instance itself. so "redefine" this method.prototype.

// Note that this leads to a wrong result if the LCMCalculator object members "a" and/or "b" are altered afterwards.. return a. }.) // Also. }. // Object property names can be specified by strings . this['gcd'] === this.gcd this['gcd'] = function() { return a. 'gcd' === "gcd".

lcm: function() { // Variable names don't collide with object properties.gcd() * this.a*this. so "redefine" this method. // not using |this..g. |lcm| is not |this.b| to avoid FP precision issues var lcm = this. . this. // Only need to calculate lcm once.delimited by double (") or single (') quotes.lcm = function() { return lcm.lcm|. e.a / this.b.

// Define generic output function. }. return lcm.appendChild(d . }. this implementation only works for Web browsers function output(x) { document.b.a + ". } }. toString: function() { return "LCMCalculator: a = " + this. b = " + this.body.

[22. . 55].body.ocument. } // Note: Array's map() and forEach() are defined in JavaScript 1. [21.appendChild(d ocument.6. document.createElement('br') ).createTextNode(x)). 58]. // They are used here to demonstrate JavaScript's inherent functional nature. 56]. [ [25.

called "arrow function" . function printResult(obj) { output(obj + ". }). gcd = " + .b.map(function(pair) { // array literal + mapping function return new LCMCalculator(pair[0]. 56] ].lcm() . [28.sort((a. => is a shorthand form of a function.forEach(printResult). pair[1]).lcm()) // sort with this comparative function. b) => a.

b = 56. b = 55. lcm = 56 LCMCalculator: a = 21. lcm = 638 Use in Web pages . gcd = 5.gcd() + ". } The following output should be displayed in the browser window. LCMCalculator: a = 28. gcd = 28.lcm()). gcd = 2. b = 56. obj. lcm = " + obj. lcm = 168 LCMCalculator: a = 25. b = 58. gcd = 7. lcm = 275 LCMCalculator: a = 22.

Some simple examples of this usage are: Loading new page content or submitting data to the server via Ajax without reloading the page (for example. a social network might allow the user to post status updates without leaving the page).5% of 10 million most popular web pages used JavaScript. Scripts are embedded in or included from HTML pages and interact with the Document Object Model (DOM) of the page.[50] The most common use of JavaScript is to add client-side behavior to HTML pages.As of May 2017 94. also known as Dynamic HTML (DHTML). .

personalization or other purposes. moving them. Transmitting information about the user's reading habits and browsing activities to various websites. Validating input values of a Web form to make sure that they are acceptable before being submitted to the server. and playing audio and video. ad tracking. etc. Animation of page elements. Interactive content. Web pages frequently do this for Web analytics. resizing them. fading them in and out. for example games.[51] Because JavaScript code can run locally in a user's browser (rather than on a .

remote server). The wider trend of Ajax programming similarly exploits this strength. such as individual keystrokes. A JavaScript engine (also known as JavaScript interpreter or JavaScript . JavaScript code can detect user actions that HTML alone cannot. Applications such as Gmail take advantage of this: much of the user- interface logic is written in JavaScript. making an application more responsive. the browser can respond to user actions quickly. Furthermore. and JavaScript dispatches requests for information (such as the content of an e- mail message) to the server.

is implemented in C.5) to conform to ECMAScript 3. created primarily by Norris Boyd (formerly at Netscape. The engine. . code-named SpiderMonkey.implementation) is an interpreter that interprets JavaScript source code and executes the script accordingly. now at Google) is a JavaScript implementation in Java. The Rhino engine. for the Netscape Navigator Web browser. like SpiderMonkey. The first JavaScript engine was created by Brendan Eich at Netscape. is ECMAScript 3 compliant. Rhino. It has since been updated (in JavaScript 1.

it has become a target language for many frameworks in other . Web browsers typically create "host objects" to represent the DOM in JavaScript. The Web server is another common host environment.A Web browser is by far the most common host environment for JavaScript. Because JavaScript is the only language that the most popular browsers share support for. which a JavaScript program could then interrogate and manipulate to dynamically generate Web pages. A JavaScript Web server would typically expose host objects representing HTTP request and response objects.

even though JavaScript was never intended to be such a language. Example script Below is a minimal example of a standards-conforming Web page containing JavaScript (using HTML 5 syntax) and the DOM: <!DOCTYPE html> <html> . the increasing speed of JavaScript engines has made the language a surprisingly feasible compilation target.[52] Despite the performance limitations inherent to its dynamic nature.languages.

// Show a dialog var myTextNode = . <head> <title>Example</title> </head> <body> <button id="hellobutton">Hello</but ton> <script> document.getElementById('he llobutton').onclick = function() { alert('Hello world!').

createTextNode('So me new words.body.').appendChild(m yTextNode). document. // Append "Some new words" to the page }. document. </script> </body> </html> Compatibility considerations Because JavaScript runs in widely varying environments. an important part of testing and debugging is to test and .

JavaScript authors can attempt to write standards-compliant code that will also be executed correctly by most browsers. The DOM interfaces for manipulating Web pages are not part of the ECMAScript standard. they can write code that . failing that. Officially. To deal with these differences. and not all browsers execute JavaScript.verify that the JavaScript works across multiple browsers. in practice. or of JavaScript itself. the DOM interfaces are defined by a separate standardization effort by the W3C. browser implementations differ from the standards and from each other.

[54][55] Programmers may also use libraries or toolkits that take browser differences into account. a user may: use an old or rare browser with incomplete or unusual DOM support. Furthermore. . and authors may find it practical to detect what browser is running and change their script's behavior to match.[53] In some cases. two browsers may both implement a feature but with different behavior.checks for the presence of certain browser features and behaves differently if they are not available. For example. scripts may not work for some users.

To support these users. have JavaScript execution disabled as a security precaution. a visual disability. In particular. for example. Some sites use the HTML <noscript> tag. use a speech browser due to. Web authors can try to create pages that degrade gracefully on user agents (browsers) that do not support the page's JavaScript. the page should remain usable albeit without the extra features that the JavaScript would have added. use a PDA or mobile phone browser that cannot execute JavaScript. An alternative approach that many find . which contains alt content if JS is disabled.

scripts are constrained by . First. This is known as progressive enhancement. not general- purpose programming tasks like creating files. scripts run in a sandbox in which they can only perform Web-related actions. Second.preferable is to first author content using basic technologies that work in all browsers. Security JavaScript and the DOM provide the potential for malicious authors to deliver scripts to run on a client computer via the Web. Browser authors contain this risk using two restrictions. then enhance the content for users that have JavaScript enabled.

There are subsets of general JavaScript —ADsafe. . or cookies sent to another site. Secure ECMAScript (SES)—that provide greater levels of security. Most JavaScript-related security bugs are breaches of either the same origin policy or the sandbox.the same-origin policy: scripts from one Web site do not have access to information such as usernames.[56][57] Caja is another project for safe embedding and isolation of third-party JavaScript and HTML. especially on code created by third parties (such as advertisements). passwords.

XSS vulnerabilities occur when an attacker is able to cause a target Web site. a violation of the same-origin policy. such as an online banking website. The script in this example can then access the banking application with the privileges of the victim. Cross-site vulnerabilities A common JavaScript-related security problem is cross-site scripting (XSS).Content Security Policy is the main intended method of ensuring that only trusted code is executed on a Web page. potentially disclosing secret . to include a malicious script in the webpage presented to a victim.

information or transferring money without the victim's authorization. Only correct design of Web applications on the server side can fully prevent XSS. such as those where the malicious code is stored in a database. XSS vulnerabilities can also occur because of implementation mistakes by . However. even users of those browsers are vulnerable to other XSS attacks. A solution to XSS vulnerabilities is to use HTML escaping whenever displaying untrusted data. in which the attacker provides a URL including malicious script. Some browsers include partial protection against reflected XSS attacks.

In general. then requests initiated by code on the attacker's site will carry the same legitimate login credentials as requests initiated by the user. the solution to CSRF is to require an authentication value in a hidden form field.[58] Another cross-site vulnerability is cross- site request forgery (CSRF). to .browser authors. and not only in the cookies. code on an attacker's site tricks the victim's browser into taking actions the user didn't intend at a target site (like transferring money at a bank). if the target site relies only on cookies to authenticate requests. It works because. In CSRF.

Possible solutions include: requiring an authentication token in the POST and GET parameters for any response that returns private information.authenticate any request that might have lasting effects. "JavaScript hijacking" is a type of CSRF attack in which a <script> tag on an attacker's site exploits a page on the victim's site that returns private information such as JSON or JavaScript. Checking the HTTP Referrer header can also help. Misplaced trust in the client .

Some implications are: Web site authors cannot perfectly conceal how their JavaScript operates because the raw source code must be sent to the client.Developers of client-server applications must recognize that untrusted clients may be under the control of attackers. The application author cannot assume that his JavaScript code will run as intended (or at all) because any secret embedded in the code could be extracted by a determined adversary. The code can be obfuscated. . but obfuscation can be reverse-engineered.

or filters invalid characters out of fields that should only contain numbers. so JavaScript can't be relied on to prevent operations such as right-clicking on an image to save it. Misplaced trust in developers . If a site verifies that the user agreed to its terms of service. not security. JavaScript form validation only provides convenience for users. not only the client.[59] It is extremely bad practice to embed sensitive information such as passwords in JavaScript because it can be extracted by an attacker. it must do so on the server. Scripts can be selectively disabled.

Developers trust that the maintainers of the libraries will keep it secure and up to date. Relied upon libraries can release an update that causes bugs or vulnerabilities to appear in all programs that rely upon the library. Inversely. but that is not always the case.Package management systems such as NPM and Bower are popular with JavaScript developers. Such systems allow a developer to easily manage their program's dependencies upon other developer's program libraries. A vulnerability has emerged because of this blind trust. a library can go unpatched with known vulnerabilities out in the wild. In a study done looking over a sample of 133k .

[61][62] . This caused all tens of thousands of programs and websites depending upon his libraries to break."[60] Another possibility is that the maintainer of a library may remove the library entirely.[60] "The median lag between the oldest library version used on each website and the newest available version of that library is 1. and development of some libraries still in active use ceased years ago. This occurred in March 2016 when Azer Koçulu removed his repository from NPM.websites.177 days in ALEXA. researchers found 37% of the websites included a library with at-least one known vulnerability.

This code is not by any means limited to another JavaScript application. For example. some of which may have flaws such as buffer overflows. These flaws can allow attackers to write scripts that would run any code they wish on the user's system. These flaws have affected major browsers including Firefox. a buffer overrun exploit can allow an attacker to gain access to the operating system's API with superuser privileges.[63] Internet .Browser and plugin coding errors JavaScript provides an interface to a wide range of browser capabilities.

[66][67] In Windows Vista. Adobe Flash. such as video players. Microsoft has attempted to contain the risks of bugs such as buffer overflows by running the Internet Explorer process with limited privileges.Explorer. Sandbox implementation .[65] Plugins. and the wide range of ActiveX controls enabled by default in Microsoft Internet Explorer.[64] and Safari.[68] Google Chrome similarly confines its page renderers to their own "sandbox". may also have flaws exploitable via JavaScript (such flaws have been exploited in the past).

Incorrectly granting privileges to JavaScript from the Web has played a role in vulnerabilities in both Internet Explorer[69] and Firefox. Microsoft demoted JScript's privileges in Internet Explorer. Of course. with the privileges necessary to.errors Web browsers are capable of running JavaScript outside the sandbox. such privileges aren't meant to be granted to code from the Web.[70] In Windows XP Service Pack 2. create or delete files. for example.[71] Microsoft Windows allows JavaScript source files on a computer's hard drive to .

This makes JavaScript (like VBScript) a theoretically viable vector for a Trojan horse. although JavaScript Trojan horses are uncommon in practice. non- sandboxed programs (see: Windows Script Host).[73][74] Uses outside Web pages .[72] Hardware vulnerabilities In 2017 a JavaScript based attack via browser was demonstrated that could bypass ASLR.be launched as general-purpose. It's called "ASLR⊕Cache" or AnC.

Apple's Dashboard Widgets. Each of these applications provides its own object model that provides access to the host environment.In addition to Web browsers and servers. Apple's Safari 5 extensions. Google Desktop Gadgets. and . Yahoo! Widgets. JavaScript interpreters are embedded in a number of tools. Opera's extensions. The core JavaScript language remains mostly the same in each application. Microsoft's Gadgets. Embedded scripting language Google's Chrome extensions.

Serence Klipfolio are implemented using JavaScript. The MongoDB database accepts queries written in JavaScript. The Clusterpoint database accept queries written in JS/SQL. . MongoDB and NodeJS are the core components of MEAN: a solution stack for creating Web applications using just JavaScript. which is a combination of SQL and JavaScript. Clusterpoint has built-in computing engine that allows execution of JavaScript code right inside the distributed database.

released by Cycling '74.org. allow scripting through JavaScript.[75] Tools in the Adobe Creative Suite. offers a JavaScript model of its environment for use by developers. . an office application suite. and InDesign.Adobe's Acrobat and Adobe Reader support JavaScript in PDF files. Illustrator. allows JavaScript to be used as a scripting language. It allows users to reduce visual clutter by using an object for a task rather than many. as well as its popular fork LibreOffice. The visual programming language Max. OpenOffice. Dreamweaver. including Photoshop.

[77] DX Studio (3D engine) uses the SpiderMonkey implementation of JavaScript for game and simulation logic.Apple's Logic Pro X digital audio workstation (DAW) software can create custom MIDI effects plugins using JavaScript.[76] The Unity game engine supports a modified version of JavaScript for scripting via Mono.[79] .[78] Maxwell Render (rendering software) provides an ECMA standard based scripting engine for tasks automation.

Google Apps Script in Google Spreadsheets and Google Sites allows users to create custom formulas. Scripting engine . use JavaScript for their scripting abilities.[80] Many IRC clients.7 as internal scripting language. automate repetitive tasks and also interact with other Google products such as Gmail. like ChatZilla or XChat.[83] The text editor UltraEdit uses JavaScript 1.[81][82] RPG Maker MV uses JavaScript as its scripting language. introduced with version 13 in 2007.

analogous to Java's javax.[84] Java introduced the javax. Thus. much like Web browsers host scripts that access a webpage's Document Object Model (DOM).[87] .[85][86] The Qt C++ toolkit includes a QtScript module to interpret JavaScript. Java applications can host scripts that access the application's variables and objects.script package in version 6 that includes a JavaScript implementation based on Mozilla Rhino.script package.Microsoft's Active Scripting technology supports JScript as a scripting language.

OS X Yosemite introduced JavaScript for Automation (JXA). which is built upon JavaScriptCore and the Open Scripting Architecture. Late Night Software's JavaScript OSA (also known as JavaScript for OSA. It is based on the Mozilla JavaScript 1.5 implementation. Application platform . or JSOSA) is a freeware alternative to AppleScript for OS X. with the addition of a MacOS object for interaction with the operating system and third-party applications. It features an Objective-C bridge that enables entire Cocoa applications to be programmed in JavaScript.

as well as custom classes for various . Adobe AIR (Adobe Integrated Runtime) is a JavaScript runtime that allows developers to create desktop applications. CA Technologies AutoShell cross- application scripting environment is built on the SpiderMonkey JavaScript engine.ActionScript. It contains preprocessor-like extensions for command definition. is another implementation of the ECMAScript standard. the programming language used in Adobe Flash. Electron is an open-source framework developed by GitHub.

Apache Cordova is a mobile application development framework Cocos2d is an open source software framework. and COM scripting. apps and other cross platform GUI based interactive programs Chromium Embedded Framework (CEF) is an open source framework for embedding a web browser engine based on the Chromium core RhoMobile Suite is a set of development tools for creating data- . operation system command invocation and redirection.system-related tasks like file I/O. It can be used to build games.

js call all Node.[90] The Mozilla application framework (XPFE) platform. native mobile consumer and enterprise applications.js modules directly from DOM and enable a new way of writing applications with all Web technologies.centric. and some other Web browsers. NW. uses JavaScript to implement the graphical user interface (GUI) of its various products. Thunderbird. which underlies Firefox. . the shell for the GNOME 3 desktop environment.[89] made JavaScript its default programming language in 2013. cross-platform.[88] GNOME Shell.

Its declarative syntax is also similar to JavaScript.Qt Quick's markup language (available since Qt 4. from phones and tablets to PCs and TVs[92] WinJS provides a special Windows Library for JavaScript functionality in Windows 8 that enables the development of Modern style (formerly .[91] enyo JS is a framework to develop apps for all major platforms. Open webOS is the next generation of web-centric platforms built to run on a wide range of form factors. Ubuntu Touch provides a JavaScript API for its unified usability interface.7) uses JavaScript for its application logic.

NativeScript is an open-source framework to develop apps on the Apple iOS and Android platforms. Metro style) applications in HTML5 and JavaScript. Because there can be implementation differences . non-trivial programs. Weex is a framework for building Mobile cross-platform UI. access to a debugger becomes invaluable when developing large. created by China Tech giant Alibaba[93] XULRunner is packaged version of the Mozilla platform to enable standalone desktop application development Development tools Within JavaScript.

closely followed by Microsoft Script Editor (a component of Microsoft Office). Safari. Firefox.[98] and finally the free Microsoft Script Debugger that is far more basic .between the various browsers (particularly within the DOM). it is useful to have access to a debugger for each of the browsers that a Web application targets.[94] Script debuggers are integrated within Internet Explorer. Opera and Node. three debuggers are available for Internet Explorer: Microsoft Visual Studio is the richest of the three.[95][96][97] In addition to the native Internet Explorer Developer Tools.js. Google Chrome.

than the other two. The free Microsoft Visual Web Developer Express provides a limited version of the JavaScript debugging functionality in Microsoft Visual Studio. Also. or the older Venkman debugger. Old versions of Firefox without these tools used a Firefox addon called Firebug. WebKit's Web Inspector includes a JavaScript debugger. Internet Explorer has included developer tools since version 8. A modified version called Blink DevTools is used in Google . In comparison to Internet Explorer. Firefox has a more comprehensive set of developer tools.[99] which is used in Safari. which include a debugger as well.

Many libraries for JavaScript. Opera includes a set of tools called Dragonfly. provide links . available in Google Chrome.[100] In addition to the native computer software. such as three. there are online JavaScript IDEs. an interactive debugger that integrates with the Blink DevTools. debugging aids that are themselves written in JavaScript and built to run on the Web. Node. JSLint scans JavaScript code for conformance to a set of standards and guidelines. developed by Douglas Crockford who has written extensively on the language.js has Node Inspector.Chrome. An example is the program JSLint.js.

Benchmark tools for developers Since JavaScript is getting more important for web development (frontend overtakes many aspects which were done in backend before).to demonstration code that can be edited by users. there is also . They are also used as a pedagogical tool by institutions such as Khan Academy[101] to allow students to experience writing code in an environment where they can see the output of their programs. without needing any setup beyond a Web browser.

A library for doing benchmarks is benchmark. Another tool is jsben.ch . Especially mobile devices could have problems with rendering and processing unoptimized complex logic. where code snippets can be tested against each other. An online JavaScript benchmarking tool.js . A benchmarking library that supports high-resolution timers and returns statistically significant results. Version history .more consideration done about performance.

JavaScript was initially developed in 1996 for use in the Netscape Navigator Web browser. In the same year Microsoft released an implementation for Internet Explorer. Firefox 4 was the last version which referred to a JavaScript version (1. This implementation was called JScript due to trademark issues. The explicit versioning and opt-in of language features was Mozilla-specific and has been removed. With new editions of the ECMA-262 standard. JavaScript language features are now often .8. In 1997 the first standardized version of the language was released under the name ECMAScript in the first edition of the ECMA-252 standard.5).

mentioned with their initial definition in the ECMA-262 editions.[102][103][104] . The following table is based on information from multiple sources.

7). Release Netscape Mozilla Internet Google Version Equivalent to Opera Safari date Navigator Firefox Explorer Chrome March 1.0 2. 1.0 1996 August 1.6 and string 1.7 + 3.5 2005 generics + E4X 1.50 2008 generator expressions + .0 5[105] 1998 + 2nd edition Netscape 1.6 + Pythonic October 1.1 3.0 7.8 June 1.8) 1.6).0 11.5 (JScript 5.5).666 2000 edition 7 (JScript 5.4 6 Server 5.0.3 4.95 2006 iterators + let 1.05 3 1997 October ECMA-262 1st 1.0 28.0 3.0 3.1500.0-4.7 generators + 2.0.5 6.06-4.5 + array extras + array November 1.2 4.0 1.0 1996 June 1.7x 4.0-10.0-5 1. 6 (JScript November ECMA-262 3rd 5. 8 (JScript 5.

8 + native JSON support 1.5 + minor updates June 22.0 2010 edition compliance Related languages and features JSON.2 3. is a general-purpose data interchange format that is defined as a subset of JavaScript's object literal syntax. 1.1 3. Like much of JavaScript (regexps and anonymous functions as 1st class elements. 'use strict'). expression closures 1. flexible classes. or JavaScript Object Notation. closures. 1. JSON.1 + minor 1.8.5 ECMA-262 5th 4.8.8.6 2009 updates 1.8. except for replacing Perl's .2 + new features for July 27.8.

is syntactically pure Perl. jQuery is a popular JavaScript library designed to simplify DOM-oriented client- side HTML scripting along with offering cross-browser compatibility because various browsers respond differently to certain vanilla JavaScript code.key-value operator '=>' by an RFC 822[106] inspired ':'. Angular and AngularJS are web application frameworks to use for .js is a utility JavaScript library for data manipulation that is used in both client-side and server-side network applications. Underscore.

Mozilla-specific support for LiveConnect was scheduled to be phased out in the future in favor of passing on the LiveConnect handling via NPAPI to the Java 1.developing single-page applications and also cross-platform mobile apps. Mozilla browsers currently support LiveConnect. a feature that allows JavaScript and Java to intercommunicate on the Web. React (JavaScript library) is an open- source JavaScript library providing a views that is rendered using components specified as custom HTML tags. However.[107] Most .6+ plug-in (not yet supported on the Mac as of March 2010).

Programs are written using only six different characters. but are still valid JavaScript code.js[109] is an object oriented JavaScript library designed for artists and . asm. include JavaScript interpreters that can act on the visible page's DOM. such as Firebug in Firefox.js is a subset of JavaScript that can be run in any JavaScript engine or run faster in an ahead-of-time (AOT) compiling engine.[108] JSFuck is an esoteric programming language. p5.browser inspection tools.

Reformat code.designers. where different code snippets can be tested against each other. CRISP: A Strategy guiding Cloud Application Development for Beginners is a strategy proposed by Ayush Sahu to develop optimized and secure JavaScript application to be used in mobiles. CRISP (Conversion. Sandbox. Partition) strategy has been proposed for refined conversion of native application to JavaScript for cloud application .ch is an online JavaScript benchmarking tool. jsben. PC's and other devices. Isolate module. It is based on the ideas of the Processing project but is for the web.

development. JavaScript is chosen as
medium for writing application because
it is mostly used language among
developers and provides rich API
(Application Programming Interface) for
writing applications.[110]

Use as an intermediate
language

As JavaScript is the most widely
supported client-side language that can
run within a Web browser, it has become
an intermediate language for other
languages to target. This has included
both newly created languages and ports

of existing languages. Some of these
include:

OberonScript, a full implementation of
the Oberon programming language
that compiles to high-level
JavaScript.[111]
Objective-J, a superset of JavaScript
that compiles to standard JavaScript.
It adds traditional inheritance and
Smalltalk/Objective-C style dynamic
dispatch and optional pseudo-static
typing to JavaScript.
Processing.js, a JavaScript port of the
Processing programming language
designed to write visualizations,
images, and interactive content. It

allows Web browsers to display
animations, visual applications, games
and other graphical rich content
without the need for a Java applet or
Flash plugin.
CoffeeScript, an alternate syntax for
JavaScript intended to be more
concise and readable. It adds features
like array comprehensions (also
available in JavaScript since version
1.7)[112] and pattern matching. Like
Objective-J, it compiles to JavaScript.
Ruby and Python have been cited as
influential on CoffeeScript syntax.
Google Web Toolkit translates a subset
of Java to JavaScript.

Scala. open source language that compiles to JavaScript. .js[115] Fantom a programming language that runs on JVM. Emscripten.NET and JavaScript. .[114] a Racket-to-JavaScript compiler. an object-oriented and functional programming language.[113] Pyjs. has a Scala-to-JavaScript compiler. Google Dart. known as asm. a LLVM-backend for porting native libraries to JavaScript. Whalesong. a port of Google Web Toolkit to Python translates a subset of Python to JavaScript. an all-purpose.

interfaces and modules. Elm- generates JavaScript has zero runtime . The compiler is itself written in TypeScript.TypeScript. and essentially adds support for optional type annotations and some other language extensions such as classes. a free and open-source programming language developed by Microsoft. It is a superset of JavaScript. Unlike handwritten JavaScript. A TS-script compiles into plain JavaScript and can be executed in any JS host supporting ECMAScript 3 or higher. Elm (programming language) is a pure functional language for web apps.

Haxe. and enforced semantic versioning. a virtual machine and DOM environment for the open-source .exceptions. an open-source high-level multiplatform programming language and compiler that can produce applications and source code for many different platforms including JavaScript.[116] a compiler for Clojure that targets JavaScript. ClojureScript. a time-traveling debugger. It is designed to emit JavaScript code that is compatible with the advanced compilation mode of the Google Closure optimizing compiler. SqueakJS .

JavaScript and Java A common misconception is that JavaScript is similar or closely related to Java. It is true that both have a C-like syntax (the C language being their most . only double-precision binary floating point – languages that compile to JavaScript and do not take care to use the integer- converting shift and bitwise logical operators may have slightly different behavior than in other environments. Squeak implementation of the Smalltalk programming language. As JavaScript has unusual limitations – such as no explicit integer type.

immediate common ancestor language). and JavaScript was designed with Java's syntax and standard library in mind. .[117] but the similarities end there. In particular. JavaScript's standard library follows Java's naming conventions. Java and JavaScript both first appeared on 23 May 1995. but Java was developed by James Gosling of Sun Microsystems.0. They also are both typically sandboxed (when used inside a browser). all Java keywords were reserved in original JavaScript. and JavaScript's Math and Date objects are based on classes from Java 1.

while JavaScript is loaded as human-readable source code. while JavaScript's are prototype- based. Java has static typing. Java did not support functional programming until Java 8. The differences between the two languages are more prominent than their similarities. while JavaScript has done so from the beginning. Finally. Java's objects are class- based. Java is loaded from compiled bytecode. being influenced by Scheme. while JavaScript's typing is dynamic.and JavaScript by Brendan Eich of NetScape Communications. See also .

 1–2. . pp. Mac OS X Reference Library. Apps. 1995 3. "Netscape and Sun announce JavaScript". 4. 5. Apple Inc. 2017-07-03. WebAssembly References 1.ietf.org. PR Newswire. "System-Declared Uniform Type Identifiers" . December 4. Retrieved 16 February 2016. 2. "Standard ECMA-262" . Ecma International. Archived from the original on 2014-03-16. Flanagan 2011. "RFC 4329" . Retrieved 2010-03-05. Press release announcing JavaScript .

57 . 4. 8. p. "Chapter 4. 10. Severance. Computer. . "JavaScript: Designing a Language in 10 Days" . How JavaScript Was Created" . "ECMAScript Language Overview" (PDF) . William Collins Sons & Co. 7. "JavaScript" . Collins English Dictionary – Complete & Unabridged 2012 Digital Edition. Retrieved 23 March 2013. doi:10. Retrieved 21 August 2015.1109/MC. Retrieved 2009-05-03. IEEE Computer Society.6. 9. 2012. 45 (2): 7–8. "TechVision: Innovators of the Net: Brendan Eich and JavaScript" .2012. Charles (February 2012). 2007-10-23.

"New JavaScript Engine Module Owner" . 15.com. Brent (24 June 2010). Wiley. Retrieved 16 July 2016. O'Reilly Media. Brent (21 September 2013). Retrieved 16 July 2016. Archived from the original on 2008-02-08. 13. Retrieved 16 July 2016. 14. "The History of Programming Languages" .org. 11. brent-noorda. "Brent Noorda's Answers on ECMA" . Noorda.com. 12.com. Eich. oreilly. Brendan (21 June 2011).web.com. quora. brendaneich. Retrieved 16 July 2016. Retrieved 16 July 2016. wiley. "What Is JavaScript?" (PDF). "History of Nombas" . 2004. Noorda.com.archive. .

Retrieved 2016-07-16. Steve (6 April 2001). 18. Retrieved 16 July 2016. Champeon. Retrieved 2016-07-16. oracle.com.com. "JavaScript. readwrite. Back with a Vengeance" . Netscape Communications Corporation (11 December 1998). Netscape Communications Corporation. "Microsoft Internet Explorer 3.0 Beta Now Available" .16. "Server-Side JavaScript. . Retrieved 16 July 2016. 19.com.com. microsoft. 29 May 1996. Michael (17 December 2009). "Server- Side JavaScript Guide" . How Did We Get Here?" . Microsoft. 17. Mahemoff. oreilly.

Retrieved 16 July 2016. Kowal. Crockford. The World's Most Misunderstood Programming Language" . "Documentation" .com. crockford.20. "CommonJS Effort Sets JavaScript on . Harry (16 September 2010). 24. ecmascript. technologizer.com. 2017-07-03. 22. McCracken.org. Ecma International. "The Unwelcome Return of "Best Viewed with Internet Explorer" " . 23. Kris (1 December 2009). Retrieved 16 July 2016. 21. "Standard ECMA-262" . Douglas (2001). Retrieved 16 July 2016. "JavaScript.

JavaScript | MDN" .Path for World Domination" . 29. 16. "JavaScript data types and data structures . 28. 25. Sun Microsystems. Flanagan 2006. Flanagan 2006. Mozilla Developer Network. 176–178. USPTO. 27. p. Developer. 26. Retrieved 2017-02-24.mozilla. arstechnica. Archived from the original on 28 May 2010. "Sun Trademarks" . pp.org. . Mozilla. Retrieved 16 July 2016. "USPTO Copyright entry #75026640" .com. Retrieved 2007-11-08. "Inheritance and the prototype chain" . 2017-02-16. Retrieved 6 April 2013. 30.

 125–127. ISBN 978-0-321-81218-6. Herman. ISBN 978-0-321-81218-6. "Understanding "Prototypes" in JavaScript" . Es5. Herman. Retrieved 2013-05-26. ISBN 978-1-59327-282-1. Effective JavaScript. 83. Addison-Wesley.github. Haverbeke. "Properties of the Function Object" . . 141. 32. 36. p. Flanagan 2006. Yehuda. No Starch Press.31.com. David (2013). Marijn (2011). Addison-Wesley. Effective JavaScript. Eloquent JavaScript. p. 33. pp. pp. Retrieved 6 April 2013. David (2013). 34. 35. Katz. 95–97.

"Home | CocktailJS" . Cocktailjs. 40. Peterseliger. Marijn (2011). 2010. 139–149. 42.de.io. April 11. 39. Mozilla Developer Network. 2011. "Concurrency model and Event Loop" .github. The many talents of JavaScript for generalizing Role-Oriented Programming approaches like Traits and Mixins . Eloquent JavaScript. Retrieved 2017-02-24. Haverbeke. published May 31. 2014. Traits for JavaScript . A fresh look at JavaScript Mixins . pp. 38. Angus Croll. 41. ISBN 978-1-59327-282-1.blogpsot. No Starch Press. .37. Retrieved 2015-08-28.

43. Robert Nyman, Getters And Setters
With JavaScript – Code Samples And
Demos , Robertnyman.com, published 29
May 2009, accessed 2 January 2010.
44. John Resig, JavaScript Getters and
Setters , Ejohn.org, 18 July 2007,
accessed 2 January 2010
45. "E4X – Archive of obsolete content |
MDN" . Mozilla Developer Network.
Mozilla Foundation. Feb 14, 2014.
Retrieved 13 July 2014.
46. "var – JavaScript – MDN" . The
Mozilla Developer Network. Retrieved
22 December 2012.
47. "ECMAScript Language Specification –
ECMA-262 Edition 5.1" . Ecma

International. Retrieved 22 December
2012.
48. "console" . Mozilla Developer Network.
Mozilla. Retrieved 6 April 2013.
49. "arguments" . Mozilla Developer
Network. Mozilla. Retrieved 6 April 2013.
50.
https://w3techs.com/technologies/details
/cp-javascript/all/all
51. "JavaScript tracking – Piwik" . Piwik.
Retrieved 31 March 2012.
52. Hamilton, Naomi (2008-07-31). "The A-
Z of Programming Languages:
JavaScript" . computerworld.com.au.
53. "Javascript - Object detection" .
Quirksmode.org. Retrieved 2017-02-24.

54. Peter-Paul Koch, Mission Impossible –
mouse position
55. "JavaScript - Browser detect" .
Quirksmode.org. Retrieved 2017-02-24.
56. "Making JavaScript Safe for
Advertising" . ADsafe. Retrieved
2013-05-26.
57. "Secure ECMA Script (SES)" .
Code.google.com. Retrieved 2013-05-26.
58. "Mozilla Cross-Site Scripting
Vulnerability Reported and Fixed -
MozillaZine Talkback" . Mozillazine.org.
Retrieved 2017-02-24.
59. "Right-click "protection"? Forget about
it" . 2008-06-17. ISSN 1797-1993 .
Retrieved 2008-06-17.

Paul (August 19. Mozilla Corporation.60. SC Magazine UK. 65. 61. Buffer overflow in crypto. How one programmer broke the internet by deleting a tiny piece of code 62. "Buffer- overflow bug in IE" .signText() 64. "Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Libraries on the Web" (PDF). 2002. Festa. Archived from the original on December 25. 2016-12-21. Retrieved 2017-02-22. Quartz.com. Apple Safari JavaScript Buffer Overflow Lets Remote . Developer's 11 lines of deleted code 'breaks the internet' 63. SecurityTracker. CNET. 1998).

Vulnerability Note VU#713878: Microsoft Internet Explorer does not properly validate source of redirected frame . US CERT.Users Execute Arbitrary Code and HTTP Redirect Bug Lets Remote Users Access Files 66. Blogs. "Protected Mode in Vista IE7 – IEBlog" .com. 69. Retrieved 2017-02-24. Macromedia Flash ActiveX Buffer Overflow 68. 2006-02-09. Microsoft WebViewFolderIcon ActiveX Control Buffer Overflow Vulnerability 67.msdn. Fusion Authority. SecurityFocus.

Microsoft Corporation. Mozilla Foundation Security Advisory 2005–41: Privilege escalation via DOM property overrides 71. 2017 74.K 73. For one example of a rare JavaScript Trojan Horse.Seeker. AnC VUSec. 2017 . see Symantec Corporation. JS. New ASLR-busting JavaScript is about to make drive-by exploits much nastier Ars Technica.70. Changes to Functionality in Microsoft Windows XP Service Pack 2: Part 5: Enhanced Browsing Security 72. Mozilla Foundation.

"Logic Pro X" . 77. THINK! The Maxwell Render Resourcer Center.com. Scripting References 80. "ChatZilla! Frequently Asked Questions – 4. How do I write scripts?" .5. 2017. 78. unity3d. . Retrieved 2013-01-29.hacksrus. 76. Apple. 79. Google Apps Script. dxstudio. Apple. "Technical Specification" . "Unity Scripting" . "JavaScript for Acrobat" . Google Apps Script 81. Chatzilla. Retrieved 2009-10-20. Retrieved January 31. Retrieved 11 February 2011. Inc.com.com.75. Retrieved 2009-08-18.

Retrieved 2013-05-26. "Xcdscript" .82. 83. "RPG Maker MV | RPG Maker | Make Your Own Games!" .js" . "javax. Archived from the original on 1 May 2011.io. Nwjs. Java. Retrieved 2017-02-24.script release notes" . 214 et seq. QtScript Module 88. . "Version Information (JavaScript)" . 87. Retrieved 11 February 2011. Flanagan 2006.microsoft. Retrieved 28 August 2015. pp. "NW. Retrieved 2009-05-19. 85. 84.com. 86.sun. Msdn.com. Nokia Corporation.

89. Archived from the original on 2012-12-21. alistapart.com.com. 95. Retrieved 2017-02-24. [2] 94. "Enyo JavaScript Application Framework" . [1] 92. The GNOME Journal. "Advanced Debugging With JavaScript" . "Behind the Scenes with Owen Taylor" . 93. "Answering the question: "How do I develop an app for GNOME?" " . Retrieved 2010-05-28. Enyojs. 2009-02-03.about. "The JavaScript Debugging Console" . . Retrieved 2010-01-23. 90. 91.com. 2010-05-28. javascript.

Retrieved 2010-05-28. "Opera DragonFly" . 98. Retrieved 2013-08-26. 2013-08-26. "Introducing Drosera – Surfin' Safari" . Retrieved 2014-05-07. docs. 101. Retrieved 28 Sep 2012. . 97. Webkit. "SplineTech JavaScript Debugger – an independent standalone JavaScript Debugger" .strongloop. javascript-debugger. Retrieved 2009-05-19.org.com. "Khan Academy Computer Science" . Opera Software.com. "Debugging with Node Inspector" . 100. 96. JScript development in Microsoft Office 11 (MS InfoPath 2003) 99. 2006-06-28.

org.com. Retrieved 2016-07-16. "What Version of Javascript" . Webmasterworld.org. Tools.com. 1982-08-13.102. Retrieved 2017-02-24. "Versions of JavaScript" . "RFC 822 . 106. 2016-02-22. "New in JavaScript" . Retrieved 2009-05-19.org. Ejohn. developer. John Resig.about. Javascript. . 103. Retrieved 2009-12-17.ietf. Retrieved 2017-02-24. "JavaScript – JScript – ECMAScript version history" . 105.STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES" . 2014. 104.mozilla.

Retrieved 2016-08-26. 112.microsoft.thapar.mozilla.edu:8080. "Home" .com. "Oberon Script. "New in JavaScript 1. 110. . 2012-12-05. Retrieved 2015-12-18. research. "frequently asked questions" .js. p5. Retrieved 2017-02-24.107. 109. Retrieved 2014-04-13. 108.org. Java. 2016-08-26.com. Ralph Sommerer. asm. Developer.7" .js. 2017-01-21. A Lightweight Compiler and Runtime System for the Web" . "Home" . Release Notes for the Next- Generation Java™ Plug-In Technology (introduced in Java SE 6 update 10) . 111. Retrieved on 2013-06-13.sun. dspace.

Hashcollision. Retrieved 2014-04-13. 114. Retrieved 2014-04-13. Retrieved 2014-04-13. "Scala. "clojure/clojurescript · GitHub" . Lampwww.com. "Whalesong: a Racket to JavaScript compiler" . 115. iEntry Network. Walton. Zach (2012-04-04). "Easily Port C++ To HTML5/JavaScript With Emscripten" . Further reading .epfl. 117.ch.org. 113. Brendan Eich (3 April 2008).Retrieved 2013-05-26. Github. WebProNews. "Popularity" . Sébastien Doeraene. 116.js" . Retrieved 2012-01-19.

Joe. Growney. O'Reilly & Associates. JavaScript: The Definitive Guide (5th ed. and Flash. Foundation Web Design: Essential HTML. ISBN 0-7897-2612-2. David (2006). ISBN 0-07-222887-3. Flanagan. P. Tomasz (2003). Jankowski. JavaScript Goodies. Flanagan. PhotoShop. Pearson Education. ISBN 0-596-10199-6.). Scott (2003). Burns.Bhangal. O'Reilly & . Duffy. David (2011). ISBN 1-59059-152-6. JavaScript: The Definitive Guide (6th ed. How to do Everything with JavaScript. CSS. Sham. Fireworks. JavaScript.). Andree S. Osborne. APress L. (2001).

Eloquent JavaScript. Scott (2003). JavaScript Programming for the Absolute Beginner. Brendan (2001). John Wiley & Sons. Designing with JavaScript. Harris. ISBN 978- 1-59327-282-1. ISBN 0-596- 00467-2. Koman. Eich. Nick. Goodman.Associates. JavaScript Bible. ISBN 0-7615-3410-5. No Starch Press. Haverbeke. Goodman. JavaScript and DHTML Cookbook. Richard (1997). Premier Press. Andy (2001). O'Reilly & . Heinle. Danny. Marijn (2011). Danny. O'Reilly & Associates. ISBN 978-0-596-80552-4. Markel. ISBN 0-7645-3342-8.

Franklin. McDuffie.). Tina Spain (2003). Kuslich. Prentice Hall Professional Technical References. ISBN 0-201-43329-X. ISBN 1- 887902-69-4. JavaScript: The Complete . Nigel (2003). ISBN 0-13-142343-6. Beedle & Associates. Powell. JavaScript Concepts & Techniques: Programming Interactive Web Sites. ISBN 1-56592-300-6. Husted.. Fritz (2001). Robert.Associates. JJ (1999). Server-Side JavaScript: Developing Integrated Web Applications (1st ed. Schneider. Thomas A. McFarlane. Rapid Application Development with Mozilla. Addison-Wesley.

Gary B.). Zakas. Andrew H. Emily A. Nicholas C. (2000). McGraw-Hill Companies. ISBN 0-7895-6233-2. (2004). Quasney. Pearson Education.. JavaScript For Dummies (4th ed. (2012). Professional JavaScript for Web Developers (3rd . Cambridge: Course Technology. Watt. Shelly.Reference... Jonathan A. Jinjer L. Teach Yourself JavaScript in 21 Days. Simon. Wiley Pub. Dorin. (2002). ISBN 0-07-219127-9. William J. Cashman.. JavaScript: Complete Concepts and Techniques. ISBN 0-7645-7659-3. Vander Veer. ISBN 0-672-32297-8. Thomas J. Jeffrey J.. Watt.

ed. Wrox.). External links Listen to this article (info/dl) 0:00 This audio file was created from a revision of the article "JavaScript" dated 2013-08-20. and does not reflect subsequent edits to the article. ISBN 978-1-118-02669-4. (Audio help) More spoken articles Douglas Crockford's video lectures on JavaScript Douglas Crockford's A Survey of the JavaScript Programming Language JavaScript at Curlie (based on DMOZ) List of languages that compile to JS .

org/w/index.Retrieved from "https://en.wikipedia. .php? title=JavaScript&oldid=814040451" Last edited 2 days ago by CityOfSil… Content is available under CC BY-SA 3.0 unless otherwise noted.