← CodeClarityLab Home
Browse by Category
+ added · updated 7d
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
async / await in JavaScript ES2017
async functions always return a Promise; await pauses execution inside an async function until a Promise settles — giving asynchronous code the readability of synchronous code without blocking the event loop.
4w ago javascript intermediate
ES Modules (ESM) ES2015
The official JavaScript module system — import and export statements enable static dependency graphs, tree-shaking, and native browser module loading without a bundler.
4w ago javascript intermediate
Memory Management in JavaScript
JavaScript uses automatic garbage collection — the engine reclaims memory when objects are no longer reachable. Memory leaks occur when references are unintentionally retained, preventing collection.
4w ago javascript intermediate
BigInt — Arbitrary Precision Integers ES2020
JavaScript's Number type cannot safely represent integers larger than 2⁵³−1 (Number.MAX_SAFE_INTEGER). BigInt is a separate numeric type that handles integers of arbitrary size, essential for working with 64-bit IDs from databases, cryptographic values, and precise financial calculations.
2mo ago javascript intermediate
BroadcastChannel — Cross-Tab Messaging HTML5
BroadcastChannel allows same-origin pages/tabs to communicate — post a message on one tab, receive it in all others — without a server or service worker.
2mo ago javascript intermediate
Canvas API — 2D Drawing HTML5
The HTML Canvas API provides a 2D drawing surface via JavaScript — used for charts, image manipulation, games, data visualisations, and any pixel-level rendering that DOM elements cannot efficiently handle.
2mo ago javascript intermediate
EventSource API — Server-Sent Events (Client Side) HTML5
EventSource is the browser API for consuming Server-Sent Events (SSE) — a one-directional server-to-client stream over HTTP that automatically reconnects, ideal for live feeds, notifications, and streaming LLM responses.
2mo ago javascript intermediate
Import Maps ES2020
Import maps let browsers resolve bare module specifiers (import 'lodash') without a bundler — mapping module names to URLs in a JSON script tag.
2mo ago javascript intermediate
IntersectionObserver API HTML5
IntersectionObserver fires when an element enters or leaves the viewport — the modern way to implement lazy loading, infinite scroll, and scroll-triggered animations.
2mo ago javascript intermediate
MutationObserver API HTML5
MutationObserver watches DOM tree changes — attribute changes, child additions/removals, text content changes — without polling or event listener on each node.
2mo ago javascript intermediate
Object.freeze / Object.seal ES5
Object.freeze() prevents all property changes (add/modify/delete), Object.seal() prevents add/delete but allows modification — both are shallow, not deep.
2mo ago javascript intermediate
Permissions API HTML5
The Permissions API (navigator.permissions.query()) lets you check the current state of browser permissions — granted, denied, or prompt — before requesting sensitive APIs.
2mo ago javascript intermediate
Promise.allSettled / Promise.any / Promise.race ES2020
Three Promise combinators for handling multiple async operations — allSettled() waits for all to complete regardless of failure, any() resolves with the first success, race() resolves or rejects with the first to settle.
2mo ago javascript intermediate
requestAnimationFrame — Smooth Animations HTML5
requestAnimationFrame(callback) schedules a function to run before the browser's next repaint — the correct way to animate in JavaScript, producing smooth 60fps motion and automatically pausing when the tab is hidden.
2mo ago javascript intermediate
ResizeObserver API HTML5
ResizeObserver watches element size changes without polling — more efficient than resize event listeners and works for any element, not just the window.
2mo ago javascript intermediate
Top-Level Await in Modules ES2022
ES2022 top-level await lets you use await at the module root without wrapping in async function — blocking module evaluation until the awaited Promise resolves.
2mo ago javascript intermediate
Web Locks API — Coordinating Across Tabs HTML5
The Web Locks API lets JavaScript in the same origin coordinate exclusive or shared access to a named resource across multiple tabs, workers, or iframes — a browser-native mutex.
2mo ago javascript intermediate
Accidental Object Mutation Bugs ES2015
Objects and arrays are passed by reference in JS — mutating a function parameter or array element mutates the original, causing subtle cross-component state bugs.
2mo ago javascript intermediate
Async Error Handling (try/catch + Promise) ES2017
Errors in async functions require try/catch or .catch() — a rejected Promise that's not caught becomes an unhandledRejection that crashes Node or shows a console warning in browsers.
2mo ago javascript intermediate
Classic Closure-in-Loop Bug (var vs let) ES2015
The most common JavaScript closure bug: using var in a for loop captures the loop variable by reference so all callbacks see the final value — fixed by using let which creates a new binding per iteration.
2mo ago javascript intermediate
✓ schema.org compliant