Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1068276 of JavaScript

  • Revision slug: Web/JavaScript
  • Revision title: JavaScript
  • Revision id: 1068276
  • Created:
  • Creator: eden
  • Is current revision? No
  • Comment

Revision Content

{{JsSidebar}}

JavaScript (JS) is a lightweight, interpreted, programming language with first-class functions. Most well-known as the scripting language for Web pages, many non-browser environments also use it, such as node.js and Apache CouchDB. JS is a prototype-based, multi-paradigm, dynamic scripting language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. Read more about JavaScript.

This section of the site is dedd to the JavaScript language itself, and not the parts that are specific to Web pages or other host environments. For information about {{Glossary("API","APIs")}} specific 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 is more commonly 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 2017.

Do not confuse JavaScript with the Java programming language. Both "Java" and "JavaScript" are trademarks or registered trademarks of Oracle in the U.S. and other countries. However, the two programming languages have very different syntax, semantics, and uses.

Tutorials

Learn how to program in JavaScript with guides and tutorials.

Introductory

JavaScript Guide
If you are new to JavaScript, this guide will walk you through the language.
JavaScript technologies overview
Introduction to the web browser JavaScript landscape.
Introduction to Object Oriented JavaScript
Introduction to the concepts of object oriented programming in JavaScript.

Intermediate

A re-introduction to JavaScript
An overview for those who think they know about JavaScript.
JavaScript data structures
Overview of available data structures in JavaScript.
Equality comparisons and sameness
JavaScript provides three different value-comparison operations: strict equality using ===, loose equality using ==, and the {{jsxref("Global_Objects/Object/is", "Object.is()")}} method.

Advanced

Inheritance and the prototype chain
Explanation of the widely misunderstood and under-estimated prototype-based inheritance.
Strict mode
Strict mode defines that you can not use any variable before initializing it. It is a restricted variant of ECMAScript 5, for faster performance and easier debugging.
JavaScript typed arrays
JavaScript typed arrays provide a mechanism for accessing raw binary data.
Memory Management
Memory life cycle and garbage collection in JavaScript.
Concurrency model and Event Loop
JavaScript has a concurrency model based on an "event loop".

Reference

Browse the complete JavaScript reference documentation.

Standard objects
Get to know standard built-in objects {{jsxref("Array")}}, {{jsxref("Boolean")}}, {{jsxref("Date")}}, {{jsxref("Error")}}, {{jsxref("Function")}}, {{jsxref("JSON")}}, {{jsxref("Math")}}, {{jsxref("Number")}}, {{jsxref("Object")}}, {{jsxref("RegExp")}}, {{jsxref("String")}}, {{jsxref("Map")}}, {{jsxref("Set")}}, {{jsxref("WeakMap")}} , {{jsxref("WeakSet")}}, and others.
Expressions and operators
Learn more about the behavior of JavaScript's operators {{jsxref("Operators/instanceof", "instanceof")}}, {{jsxref("Operators/typeof", "typeof")}}, {{jsxref("Operators/new", "new")}}, {{jsxref("Operators/this", "this")}}, the operator precedence, and more.
Statements and declarations
Learn how {{jsxref("Statements/do...while", "do-while")}}, {{jsxref("Statements/for...in", "for-in")}}, {{jsxref("Statements/for...of", "for-of")}}, {{jsxref("Statements/try...catch", "try-catch")}}, {{jsxref("Statements/let", "let")}}, {{jsxref("Statements/var", "var")}}, {{jsxref("Statements/const", "const")}}, {{jsxref("Statements/if...else", "if-else")}}, {{jsxref("Statements/switch", "switch")}}, and more JavaScript statements and keywords work.
Functions
Learn how to work with JavaScript's functions to develop your applications.

Tools & resources

Helpful tools for writing and debugging your JavaScript code.

Firefox Developer Tools
Scratchpad, Web Console, JavaScript Profiler, Debugger, and more.
Firebug
Edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
JavaScript Shells
A JavaScript shell allows you to quickly test snippets of JavaScript code.
TogetherJS
Collaboration made easy.
Stack Overflow
Stack Overflow questions tagged with "JavaScript".
JavaScript versions and release notes
Browse JavaScript's feature history and implementation status.
JSFiddle
Edit JavaScript, CSS, HTML and get live results. Use external resources and collaborate with your team online.

{{CommunityBox("JavaScript", "js-engine.internals", "mozilla.dev.tech.js-engine.internals", "js", "ES discuss|https://esdiscuss.org/|esdiscuss.org|ECMAScript standard discussion mailing list||SpiderMonkey|https://wiki.mozilla.org/JavaScript|Project page|Contribute to the JavaScript Engine||Twitter|https://twitter.com/SpiderMonkeyJS|@SpiderMonkeyJS|SpiderMonkey updates on Twitter")}}

Revision Source

<div>{{JsSidebar}}</div>

<p class="summary"><strong>JavaScript</strong> (<strong>JS</strong>) is a lightweight, interpreted, programming language with <a href="https://en.wikipedia.org/wiki/First-class_functions">first-class functions</a>. Most well-known as the scripting language for Web pages, <a class="external" href="https://en.wikipedia.org/wiki/JavaScript#Uses_outside_Web_pages">many non-browser environments</a> also use it, such as <a class="external" href="https://nodejs.org/">node.js</a> and <a href="https://couchdb.apache.org/">Apache CouchDB</a>. JS is a <a class="mw-redirect" href="https://en.wikipedia.org/wiki/Prototype-based_programming" title="Prototype-based programming">prototype-based</a>, multi-paradigm, dynamic scripting language, supporting object-oriented,&nbsp;imperative, and&nbsp;declarative (e.g.&nbsp;functional programming) styles. Read more <a href="/en-US/docs/Web/JavaScript/About_JavaScript">about JavaScript</a>.</p>

<p>This section of the site is dedd to the JavaScript language itself, and not the parts that are specific to Web pages or other host environments. For information about {{Glossary("API","APIs")}} specific to Web pages, please see <a href="/en-US/docs/Web/API">Web APIs</a> and <a href="/en-US/docs/Glossary/DOM">DOM</a>.</p>

<p>The standard for JavaScript is <a href="/en-US/docs/Web/JavaScript/Language_Resources">ECMAScript</a>. As of 2012, all <a href="https://kangax.github.io/compat-table/es5/">modern browsers</a> fully support ECMAScript 5.1. Older browsers support at least ECMAScript 3. On June 17, 2015, <a href="https://www.ecma-international.org">ECMA International</a> published the sixth major version of ECMAScript, which is officially called ECMAScript 2015, and is more commonly 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 <a href="https://tc39.github.io/ecma262/">ECMAScript 2017</a>.</p>

<p>Do not confuse JavaScript with the <a href="https://en.wikipedia.org/wiki/Java_(programming_language)">Java programming language</a>. Both "Java" and "JavaScript" are trademarks or registered trademarks of Oracle in the U.S. and other countries. However, the two programming languages have very different syntax, semantics, and uses.</p>

<div class="column-container">
<div class="column-half">
<h2 id="Tutorials">Tutorials</h2>

<p>Learn how to program in JavaScript with guides and tutorials.</p>

<h3 id="Introductory">Introductory</h3>

<dl>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide">JavaScript Guide</a></dt>
 <dd>If you are new to JavaScript, this guide will walk you through the language.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/JavaScript_technologies_overview">JavaScript technologies overview</a></dt>
 <dd>Introduction to the web browser JavaScript landscape.</dd>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript">Introduction to Object Oriented JavaScript</a></dt>
 <dd>Introduction to the concepts of object oriented programming in JavaScript.</dd>
</dl>

<h3 id="Intermediate">Intermediate</h3>

<dl>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript">A re-introduction to JavaScript</a></dt>
 <dd>An overview for those who <em>think</em> they know about JavaScript.</dd>
</dl>

<dl>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures">JavaScript data structures</a></dt>
 <dd>Overview of available data structures in JavaScript.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness">Equality comparisons and sameness</a></dt>
 <dd>JavaScript provides three different value-comparison operations: strict equality using <code>===</code>, loose equality using <code>==</code>, and the {{jsxref("Global_Objects/Object/is", "Object.is()")}} method.</dd>
</dl>

<h3 id="Advanced">Advanced</h3>

<dl>
 <dt><a href="/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a></dt>
 <dd>Explanation of the widely misunderstood and under-estimated prototype-based inheritance.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/Reference/Strict_mode">Strict mode</a></dt>
 <dd>Strict mode defines that you can not use any variable before initializing it. It is&nbsp;a restricted variant of ECMAScript&nbsp;5, for faster performance and easier debugging.</dd>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays">JavaScript typed arrays</a></dt>
 <dd>JavaScript typed arrays provide a mechanism for accessing raw binary data.</dd>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management">Memory Management</a></dt>
 <dd>Memory life cycle and garbage collection in JavaScript.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/EventLoop">Concurrency model and Event Loop</a></dt>
 <dd>JavaScript has a concurrency model based on an "event loop".</dd>
</dl>
</div>

<div class="column-half">
<h2 id="Reference">Reference</h2>

<p>Browse the complete <a href="/en-US/docs/Web/JavaScript/Reference">JavaScript reference</a> documentation.</p>

<dl>
 <dt><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects">Standard objects</a></dt>
 <dd>Get to know standard built-in objects {{jsxref("Array")}}, {{jsxref("Boolean")}}, {{jsxref("Date")}}, {{jsxref("Error")}}, {{jsxref("Function")}}, {{jsxref("JSON")}}, {{jsxref("Math")}}, {{jsxref("Number")}}, {{jsxref("Object")}}, {{jsxref("RegExp")}}, {{jsxref("String")}}, {{jsxref("Map")}}, {{jsxref("Set")}}, {{jsxref("WeakMap")}} , {{jsxref("WeakSet")}}, and others.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/Reference/Operators">Expressions and operators</a></dt>
 <dd>Learn more about the behavior of JavaScript's operators {{jsxref("Operators/instanceof", "instanceof")}}, {{jsxref("Operators/typeof", "typeof")}}, {{jsxref("Operators/new", "new")}}, {{jsxref("Operators/this", "this")}}, the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence">operator precedence</a>, and more.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/Reference/Statements">Statements and declarations</a></dt>
 <dd>Learn how {{jsxref("Statements/do...while", "do-while")}}, {{jsxref("Statements/for...in", "for-in")}}, {{jsxref("Statements/for...of", "for-of")}}, {{jsxref("Statements/try...catch", "try-catch")}}, {{jsxref("Statements/let", "let")}}, {{jsxref("Statements/var", "var")}}, {{jsxref("Statements/const", "const")}}, {{jsxref("Statements/if...else", "if-else")}}, {{jsxref("Statements/switch", "switch")}}, and more JavaScript statements and keywords work.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/Reference/Functions">Functions</a></dt>
 <dd>Learn how to work with JavaScript's functions to develop your applications.</dd>
</dl>

<h2 id="Tools_resources">Tools &amp; resources</h2>

<p>Helpful tools for writing and debugging your <strong>JavaScript </strong>code.</p>

<dl>
 <dt><a href="/en-US/docs/Tools">Firefox Developer Tools</a></dt>
 <dd><a href="/en-US/docs/Tools/Scratchpad">Scratchpad</a>, <a href="/en-US/docs/Tools/Web_Console">Web Console</a>, <a href="/en-US/docs/Tools/Profiler">JavaScript Profiler</a>, <a href="/en-US/docs/Tools/Debugger">Debugger</a>, and more.</dd>
 <dt><a class="external" href="https://www.getfirebug.com/">Firebug</a></dt>
 <dd>Edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/Shells">JavaScript Shells</a></dt>
 <dd>A JavaScript shell allows you to quickly test snippets of JavaScript code.</dd>
 <dt><a href="https://togetherjs.com/">TogetherJS</a></dt>
 <dd>Collaboration made easy.</dd>
 <dt><a href="https://stackoverflow.com/questions/tagged/javascript">Stack Overflow</a></dt>
 <dd>Stack Overflow questions tagged with "JavaScript".</dd>
 <dt><a href="/en-US/docs/Web/JavaScript/New_in_JavaScript">JavaScript versions and release notes</a></dt>
 <dd>Browse JavaScript's feature history and implementation status.</dd>
 <dt><a href="https://jsfiddle.net/">JSFiddle</a></dt>
 <dd>Edit JavaScript, CSS, HTML and get live results. Use external resources and collaborate with your team online.</dd>
</dl>
</div>
</div>

<p>{{CommunityBox("JavaScript", "js-engine.internals", "mozilla.dev.tech.js-engine.internals", "js", "ES discuss|https://esdiscuss.org/|esdiscuss.org|ECMAScript standard discussion mailing list||SpiderMonkey|https://wiki.mozilla.org/JavaScript|Project page|Contribute to the JavaScript Engine||Twitter|https://twitter.com/SpiderMonkeyJS|@SpiderMonkeyJS|SpiderMonkey updates on Twitter")}}</p>
Revert to this revision