JavaScript
Key concepts:
-
Variables: Containers for storing data values. Declared using
var,let, orconst. -
Data Types: JavaScript supports various data types including
number,string,boolean,null,undefined,object,symbol, andbigint. -
Operators: Symbols that perform operations on variables and values, e.g.,
+,-,*,/,=,==,===,&&,||,!,?:. -
Control Structures: Statements that control the flow of execution in a program, including
if,else,switch,for,while,do...while,break, andcontinue. -
Functions: Blocks of code designed to perform particular tasks, defined using the
functionkeyword, arrow functions() => {}, or function expressions. -
Objects: Collections of properties and methods, where a property is an association between a key and a value.
-
Arrays: List-like objects used to store multiple values in a single variable.
-
Scope: The context in which variables and functions are accessible, including global scope and local scope (function scope and block scope).
-
Closures: Functions that have access to their own scope, the scope of the outer function, and the global scope, even after the outer function has returned.
-
Promises: Objects representing the eventual completion or failure of an asynchronous operation, providing
thenandcatchmethods. -
Async/Await: Syntax for working with promises more comfortably, allowing asynchronous code to be written in a synchronous style.
-
Callbacks: Functions passed as arguments to other functions to be executed later, often used in asynchronous operations.
-
Hoisting: The behavior of moving variable and function declarations to the top of their containing scope during the compile phase.
-
Prototypes: Mechanism by which JavaScript objects inherit features from one another. Each object has a prototype, from which it can inherit properties and methods.
-
Event Loop: The process that handles asynchronous callbacks in JavaScript, allowing non-blocking operations.
-
Event Handling: The process of responding to user actions like clicks, form submissions, and keypresses, typically using event listeners.
-
DOM (Document Object Model): An API for HTML and XML documents, providing a structured representation of the document and a way to manipulate its structure, style, and content.
-
BOM (Browser Object Model): Interfaces provided by the browser for interacting with the browser window and its components, such as
window,navigator,screen,location, andhistory. -
JSON (JavaScript Object Notation): A lightweight data interchange format, easy for humans to read and write, and easy for machines to parse and generate.
-
Modules: Code organization technique allowing encapsulation and reusability, using
importandexportstatements to manage dependencies between files. -
Error Handling: Techniques for managing errors using
try,catch,finally, andthrowstatements. -
Strict Mode: A way to opt into a restricted variant of JavaScript by placing
"use strict";at the beginning of a script or function, helping to catch common coding errors and improve performance. -
This: A keyword that refers to the object from which the function was called, with behavior that varies depending on how the function is called.
-
Arrow Functions: A shorter syntax for writing functions with implicit
thisbinding, using() => {}syntax. -
Template Literals: String literals allowing embedded expressions, using backticks (
`) and${}syntax for interpolation. -
Destructuring: A syntax for extracting values from arrays or properties from objects into distinct variables.
-
Spread Operator:
...syntax used to expand iterable objects into individual elements, useful in function calls, array literals, and object literals. -
Rest Parameters:
...syntax used to represent an indefinite number of arguments as an array, providing a way to handle function parameters. -
Classes: Syntactic sugar over JavaScript's existing prototype-based inheritance, using the
classkeyword to define constructor functions and methods. -
SetTimeout/SetInterval: Functions for executing code after a delay (
setTimeout) or repeatedly at intervals (setInterval), useful for scheduling tasks. -
Regular Expressions (RegExp): Patterns used to match character combinations in strings, providing powerful tools for pattern matching and text manipulation.