What is JavaScript?

JavaScript is a high-level, dynamic, untyped interpreted programming language. It is a scripting language (a lightweight programming language) that is interpreted by the browser engine when the web page is loaded. It was designed primarily to add interactivity to Web pages and Web applications. The language was first implemented by Netscape Communications Corp. in Netscape Navigator 2 beta (1995). 
 
JavaScript is different from Java (developed in the 1990s at Sun Microsystems). Java is a powerful and much more complex programming language in the same category as C and C++. JavaScript was created by Brendan Eich at Netscape and was first introduced in December 1995 under the name of LiveScript. Later, it was renamed to JavaScript, although JavaScript’s official name is ECMAScript, which is developed and maintained by the ECMA (European Computer Manufacturer's Association) International organization. However, the two languages can inter-operate well.

Client-side JavaScript programs, or scripts, can be embedded directly in HTML source of Web pages. (Note: There is also server-side JavaScript.) Depending on the Web developer's intent, script code may run when the user opens the Web page, clicks or drags some page element with the mouse, types something on the keyboard, submits a form, or leaves the page. The fact that the JavaScript interpreter is the browser engine itself accounts for some inconsistencies in the way your JavaScript-powered page might behave in different browsers. But well-established techniques and powerful JavaScript libraries such as jQuery makes things wonderfully easier. 
 
JavaScript is an object-oriented language with prototypal inheritance (in a prototypal system, objects inherit from objects). The language supports several built-in objects, and programmers can create or delete their own objects. Prototypal inheritance makes JavaScript very different from other popular programming languages such as C++, C#, or Java featuring classes and classical inheritance. JavaScript does not have classes as in C++ or Java, however, objects can inherit properties directly from each other, forming the object prototype chain. 
 
JavaScript is an interpreted language, with optional JIT-compilation support. In older implementations (e.g. Internet Exlorer 8 and earlier, Firefox prior to 3.5), JavaScript was a purely interpreted language, which means that scripts execute without preliminary compilation, i.e. without conversion of the script text into system-dependent machine code. The user's browser interprets the script (analyzes and immediately executes it).

In modern implementations, JavaScript code may be either interpreted or compiled using a just-in-time (JIT) compiler. At run time, the browser decides whether (parts of) script code should be JIT-compiled for better performance. This makes JavaScript significantly faster and therefore more suitable for complex performance-demanding Web applications. JavaScript is widely supported and recent versions of all popular browsers have JavaScript JIT-compilers.

No comments:

Post a Comment