JavaScript is a lightweight, interpreted programming language primarily used to create dynamic and interactive content on websites.
Variables are containers for storing data values. They are declared using var, let, or const.
let has block scope, while var has function scope. let is preferred for modern JavaScript.
JavaScript has six primitive data types: string, number, boolean, null, undefined, and symbol, plus objects.
isNaN() checks if a value is NaN (Not-a-Number). It returns true if the value is not a number.
== checks for equality with type conversion, while === checks for strict equality without type conversion.
A function is a block of code designed to perform a particular task. It is executed when called.
An arrow function is a shorter syntax for writing functions, introduced in ES6. Example: const add = (a, b) => a + b;
The DOM (Document Object Model) is a programming interface for HTML and XML documents, allowing scripts to update content, structure, and styles.
An event is an action or occurrence (e.g., click, hover) that can be detected and handled using JavaScript.
null is an assigned value representing no value, while undefined means a variable has been declared but not assigned a value.
A callback function is a function passed as an argument to another function, to be executed later.
Array.map() creates a new array by applying a function to each element of the original array.
'this' refers to the object it belongs to. Its value depends on how the function is called.
Synchronous code is executed line by line, while asynchronous code allows tasks to run in the background without blocking execution.
A promise is an object representing the eventual completion (or failure) of an asynchronous operation and its resulting value.
The fetch API is used to make network requests to servers, returning promises that resolve to the response.
localStorage stores data with no expiration time, while sessionStorage stores data for the duration of the page session.
A closure is a function that retains access to its lexical scope, even when the function is executed outside that scope.
The 'new' keyword creates an instance of an object, invoking the constructor function and returning the new object.
A shallow copy creates a new object but copies references to nested objects, while a deep copy creates a new object and recursively copies all nested objects.
The event loop is a mechanism that allows JavaScript to perform non-blocking I/O operations by using a single thread.
The 'bind' method creates a new function that, when called, has its 'this' keyword set to the provided value.
call() and apply() are used to invoke functions with a specified 'this' context. The difference is in how arguments are passed: call() takes arguments individually, while apply() takes an array of arguments.
'async' declares a function as asynchronous, while 'await' pauses the execution of the async function until the promise is resolved.
The 'spread' operator (...) allows an iterable (like an array) to be expanded in places where zero or more arguments are expected.
The 'rest' operator (...) allows you to represent an indefinite number of arguments as an array.
A prototype is an object from which other objects inherit properties and methods, while a class is a blueprint for creating objects with shared properties and methods.
The 'instanceof' operator checks if an object is an instance of a specific constructor or class.
The 'setTimeout' function executes a function after a specified number of milliseconds.
The 'setInterval' function repeatedly calls a function with a fixed time delay between each call.
The 'clearTimeout' function cancels a timeout previously established by calling setTimeout().
The 'clearInterval' function cancels a timed, repeating action set by setInterval().
The 'window' object represents the browser window and provides methods and properties to interact with it.
The 'document' object represents the HTML document loaded in the browser and provides methods to manipulate it.
The 'console' object provides access to the browser's debugging console, allowing you to log messages and interact with it.
The 'localStorage' object allows you to store key/value pairs in a web browser with no expiration time.
The 'sessionStorage' object allows you to store key/value pairs in a web browser for the duration of the page session.
The 'XMLHttpRequest' object allows you to make HTTP requests to servers and handle responses asynchronously.
The 'JSON' object provides methods for parsing and stringifying JSON data, allowing you to work with JSON in JavaScript.
The 'Math' object provides properties and methods for mathematical constants and functions, such as Math.PI and Math.sqrt().
The 'Date' object represents dates and times in JavaScript, providing methods for manipulating and formatting them.
The 'RegExp' object represents a regular expression, allowing you to perform pattern matching and text manipulation.
The 'Error' object represents an error that occurs during script execution, providing information about the error.
The 'Promise.all()' method takes an array of promises and returns a single promise that resolves when all of the promises have resolved.
The 'WeakMap' object is a collection of key-value pairs where keys are objects and values can be arbitrary values. Keys are weakly referenced.
The 'WeakSet' object is a collection of objects, where objects are weakly referenced and cannot be iterated.
The 'Reflect' object provides methods for interceptable JavaScript operations, similar to those of the Proxy object.
The 'Proxy' object allows you to create a proxy for another object, enabling custom behavior for fundamental operations.
The 'Symbol' data type is a unique and immutable primitive value often used as object property keys.
The 'BigInt' data type is used to represent integers larger than the Number type can safely handle.
The 'Intl' object provides language-sensitive string comparison, number formatting, and date and time formatting.
The 'Atomics' object provides atomic operations as static methods for working with shared memory.
The 'SharedArrayBuffer' object represents a generic, fixed-length raw binary data buffer that can be shared between workers.
The 'WebAssembly' object provides an interface for compiling and running WebAssembly modules.
The 'import.meta' object provides metadata about the current module, such as its URL.
The 'dynamic import' syntax allows you to import modules dynamically at runtime using the import() function.
An 'async generator' function allows you to yield promises and use the 'await' keyword inside the generator.
The 'for await...of' loop iterates over async iterable objects, awaiting each value before proceeding.
The 'optional chaining' operator (?.) allows you to access deeply nested properties without checking for null or undefined.
The 'nullish coalescing' operator (??) returns the right-hand operand when the left-hand operand is null or undefined.
Private fields in classes are declared with a # prefix and are accessible only within the class.
The 'static' keyword defines a method or property that belongs to the class itself rather than instances of the class.
The 'decorators' proposal allows you to annotate and modify classes and class members with reusable metadata.
The 'module' type in script tags allows you to use ES6 modules in the browser, enabling import/export functionality.
Service workers are scripts that run in the background, enabling features like offline support and push notifications.
The 'WebSockets' API provides a way to open a persistent connection between the client and server for real-time communication.
The 'BroadcastChannel' API allows communication between different browsing contexts (e.g., tabs, iframes) of the same origin.
The 'Performance' API provides methods and properties to measure the performance of web applications.
The 'MutationObserver' API provides a way to watch for changes to the DOM and react to them.
The 'IntersectionObserver' API allows you to observe changes in the intersection of a target element with an ancestor or viewport.
The 'ResizeObserver' API allows you to observe changes to the size of an element.
The 'Custom Elements' API allows you to define and use custom HTML elements with custom behavior.
The 'Shadow DOM' provides encapsulation for DOM and CSS, allowing you to create reusable components.
The 'EventTarget' interface is implemented by objects that can receive events and have listeners for them.
The 'AbortController' API allows you to abort DOM requests, such as fetch, by signaling cancellation.
The 'ReadableStream' API provides a way to read data from a source in a streaming manner.
The 'WritableStream' API provides a way to write data to a destination in a streaming manner.
The 'TransformStream' API provides a way to read and write data in a streaming manner, transforming the data as it passes through.
The 'File API' provides methods and properties to work with files and file-like objects in web applications.