--- title: Про JavaScript slug: Web/JavaScript/About_JavaScript tags: - JavaScript - Вступ - Початківець translation_of: Web/JavaScript/About_JavaScript ---
{{JsSidebar}}

Що таке JavaScript?

JavaScript® (зазвичай скорочено JS) це легка, інтерпретована, об'єктно-орієнтована мова програмування з функціями першого класу, що також відома як найкраща мова скриптів для веб-сторінок, проте також часто використовувана в багатьох не-браузерних середовищах. Це також базована на прототипах, мульти парадигмова динамічна мова скриптів, що підтримує об'єктно-орієнтовані, імперативні та функціональні стилі програмування.

JavaScript працює на клієнтській стороні Вебу і може використовуватись для програмування поведінки сторінки відповідно до події, що на ній відбувається. JavaScript легка для вивчення, проте водночас це потужна мова скриптів, яка широко застосовується для контролю поведінки веб-сторінок.

Contrary to popular misconception, JavaScript is not "Interpreted Java". In a nutshell, JavaScript is a dynamic scripting language supporting prototype based object construction. The basic syntax is intentionally similar to both Java and C++ to reduce the number of new concepts required to learn the language. Language constructs, such as if statements, for and while loops, and switch and try ... catch blocks function the same as in these languages (or nearly so).

JavaScript can function as both a procedural and an object oriented language. Objects are created programmatically in JavaScript, by attaching methods and properties to otherwise empty objects at run time, as opposed to the syntactic class definitions common in compiled languages like C++ and Java. Once an object has been constructed it can be used as a blueprint (or prototype) for creating similar objects.

JavaScript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for ... in), and source code recovery (JavaScript programs can decompile function bodies back into their source text).

For a more in depth discussion of JavaScript programming follow the JavaScript resources links below.

What JavaScript implementations are available?

The Mozilla project provides two JavaScript implementations. The first ever JavaScript was created by Brendan Eich at Netscape, and has since been updated to conform to ECMA-262 Edition 5 and later versions. This engine, code named SpiderMonkey, is implemented in C/C++. The Rhino engine, created primarily by Norris Boyd (also at Netscape) is a JavaScript implementation written in Java. Like SpiderMonkey, Rhino is ECMA-262 Edition 5 compliant.

Several major runtime optimizations such as TraceMonkey (Firefox 3.5), JägerMonkey (Firefox 4) and IonMonkey were added to the SpiderMonkey JavaScript engine over time. Work is always ongoing to improve JavaScript execution performance.

Besides the above implementations, there are other popular JavaScript engines such as:-

Each of Mozilla's JavaScript engines expose a public API which application developers can use to integrate JavaScript into their software. By far, the most common host environment for JavaScript is web browsers. Web browsers typically use the public API to create host objects responsible for reflecting the DOM into JavaScript.

Another common application for JavaScript is as a (Web) server side scripting language. A JavaScript web server would expose host objects representing a HTTP request and response objects, which could then be manipulated by a JavaScript program to dynamically generate web pages. Node.js is a popular example of this.

JavaScript resources

SpiderMonkey
Information specific to Mozilla's implementation of JavaScript in C/C++ engine (aka SpiderMonkey), including how to embed it in applications.
Rhino
Information specific to the JavaScript implementation written in Java (aka Rhino).
Language resources
Pointers to published JavaScript standards.
A re-introduction to JavaScript
JavaScript guide and JavaScript reference.

JavaScript® is a trademark or registered trademark of Oracle in the U.S. and other countries.