The universal language of the web. Core syntax, ES6+ features, and modern asynchronous patterns.
JavaScript is a lightweight, interpreted, just-in-time compiled programming language with first-class functions. While primarily known as the scripting language for Web pages, it is heavily used in non-browser environments like Node.js.
Modern JavaScript relies strictly on block-scoped declarations to prevent memory leaks and unintended global mutations.
Template literals (backticks) provide a clean syntax for multi-line strings and dynamic expression interpolation, replacing legacy string concatenation.
The global console object provides access to the browser's debugging console.
Always use strict equality (===) to prevent JavaScript's engine from performing implicit type coercion, which can lead to unpredictable bugs.
JavaScript provides elegant operators for handling fallback values and deeply nested object properties without throwing undefined errors.
The ternary operator is a concise, inline alternative to if-else blocks, highly useful in variable assignments and React JSX.
Arrow functions (=>) provide a concise syntax and, crucially, do not bind their own this context. They inherit this from the enclosing lexical scope.
Scope dictates the visibility of variables. var is scoped to the nearest function block, whereas let and const are scoped to the nearest enclosing block ({}).
Arrays in JavaScript are dynamic. Be mindful of which methods mutate the original array versus those that return a new array.
Sets are collections of uniquely structured values. They are highly optimized for checking value existence (has).
Prefer array iterator methods (map, filter, reduce) over standard for loops for functional, non-mutating data transformations.
Objects are key-value dictionaries. Destructuring allows you to cleanly extract properties into standalone variables.
Classes are syntactic sugar over JavaScript's prototype-based inheritance, providing a cleaner, object-oriented pattern.
JavaScript relies on the ES Module (ESM) system to split code into reusable files.
Promises represent the eventual completion (or failure) of an asynchronous operation, preventing the "callback hell" of older nested architectures.
Introduced in ES2017, async/await is syntactic sugar over Promises, allowing asynchronous code to be written and read like synchronous, top-down code.
The modern standard for making HTTP requests natively in the browser, replacing the legacy XMLHttpRequest API.