JavaScript (JS) is a programming language that is lightweight, interpreted, and just-in-time compiled, and it supports first-class functions. Although it's commonly recognized as the scripting language for Web pages, JavaScript can also be utilized in various non-browser environments also use it, such as Node.js, Apache CouchDB, and Adobe Acrobat.
JavaScript is a dynamic, prototype-based, single-threaded language that supports multiple paradigms including object-oriented, imperative, and declarative styles such as functional programming.
JavaScript is a dynamic language that allows runtime object construction, variable parameter lists, function variables, and dynamic script creation. It also supports object introspection through for...in and Object utilities, as well as source-code recovery through the toString() function.
Javascript
This section focuses on the JavaScript language itself, rather than the parts specific to web pages or other host environments. For information on web-specific APIs, please refer to Web APIs and DOM.
The official standards for JavaScript are the ECMAScript Language Specification (ECMA-262) and the ECMAScript Internationalization API specification (ECMA-402). When a feature is implemented by a browser, it is documented in MDN.
MDN may use some of the new ECMAScript features that have been implemented by browsers, typically between stages 3 and 4 of development, before the official publication of the specification.
This section is dedicated to the JavaScript language itself, not to parts specific to Web pages or other host environments. For information about APIs specific to Web pages, please refer to Web APIs and DOM.
JavaScript and Java are two distinct programming languages and should not be confused with each other. Despite the similarity in their names, they have different syntax, semantics, and usage. It's important to note that "Java" and "JavaScript" are trademarks of Oracle in the U.S. and other countries.
The documentation for JavaScript's core language features mainly includes the following for pure ECMAScript:
The JavaScript guide
The JavaScript reference
For an overview of JavaScript technologies and related specifications, please refer to the JavaScript technologies overview.
Tutorials
Explore guides and tutorials to master JavaScript programming.
For complete beginners
If you're new to programming or JavaScript, check out our Learning Area JavaScript topic. It offers comprehensive modules to help you learn, including:
This module answers fundamental questions about JavaScript such as "what is JavaScript?", "what does it look like?" and "what can it do?". It also covers key JavaScript features including variables, strings, numbers, and arrays.
JavaScript building blocks
Expands on the fundamental features of JavaScript, covering conditional statements, loops, functions, and events. These commonly used code blocks are essential in programming and are widely used in JavaScript applications.
Introducing JavaScript objects
This module is designed to help you understand the object-oriented nature of JavaScript, which is crucial if you want to deepen your knowledge of the language and write more efficient code.
Asynchronous JavaScript
This module explores the significance of asynchronous JavaScript and its ability to handle blocking operations, such as retrieving data from a server. It delves into the use of callbacks, promises, and async/await to write efficient and responsive code.
Client-side web APIs
This module provides an introduction to APIs and their importance in web development. It covers some of the most frequently used APIs and demonstrates how to use them effectively in your projects.
JavaScript guide
This comprehensive guide is intended for those with prior programming experience in JavaScript or another language. It delves deeply into the nuances of the JavaScript language.
Intermediate
Understanding client-side JavaScript frameworks
Client-side frameworks are crucial for modern front-end web development as they provide developers with reliable tools to build scalable and interactive web applications. This module offers fundamental knowledge about the working of client-side frameworks and how they complement your toolset. It further includes a series of tutorials covering some of the most popular frameworks used today.
JavaScript language overview
This module provides an introduction to JavaScript syntax and semantics for programmers who are familiar with other programming languages and need to quickly learn the basics of JavaScript.
JavaScript data structures
Overview of available data structures in JavaScript.
Equality comparisons and sameness
JavaScript offers three methods of value comparison: strict equality using ===, loose equality using ==, and the Object.is() method.
Enumerability and ownership of properties
This module explains how various methods that traverse a collection of object properties handle the ownership and enumerability of properties.
Closures
A closure consists of a function and the lexical environment in which the function was defined.
Advanced
Inheritance and the prototype chain
Prototype-based inheritance is an object-oriented programming paradigm where objects inherit directly from other objects. Instead of classes, each object has a "prototype" object that defines its properties and methods.
When a property or method is accessed on an object, JavaScript looks up the prototype chain to find the closest prototype that defines the property or method and returns its value.
This approach to inheritance can be challenging for developers who are accustomed to class-based inheritance, leading to misunderstandings and underestimation of its usefulness.
JavaScript typed arrays
JavaScript-typed arrays enable developers to access raw binary data directly.
Memory Management
The memory life cycle in JavaScript refers to how the language manages memory allocation and deallocation. When a JavaScript program runs, it creates variables and objects that require memory allocation. As these variables and objects are no longer needed, they need to be deallocated to free up memory for other use.
Garbage collection is the process by which JavaScript automatically deallocates memory that is no longer needed by the program. The garbage collector identifies variables and objects that are no longer being used by the program and frees up the memory they were using.
Concurrency model and Event Loop
The concurrency model in JavaScript is built on an "event loop" mechanism.
Conclusion
JavaScript has become an integral part of modern web development, allowing developers to create dynamic and interactive web applications. From the front-end user interface to the back-end server-side operations, JavaScript has a wide range of applications that continue to evolve with new features and updates. As web technologies continue to advance, JavaScript will undoubtedly play an important role in shaping the future of the internet.