← 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
Event Loop Blocking — Long Tasks ES5
JavaScript is single-threaded — synchronous code that runs >50ms blocks the event loop, freezing UI and delaying I/O callbacks. Break long tasks into chunks.
2mo ago javascript intermediate
Hoisting — var, let, const and function ES5
JavaScript hoists declarations to the top of their scope — var and function declarations are fully hoisted, while let and const are hoisted but remain in the Temporal Dead Zone until their declaration line.
2mo ago javascript intermediate
Implicit Globals & strict mode ES5
Assigning to an undeclared variable in non-strict mode silently creates a global — use 'use strict' or ES modules to prevent accidental global pollution.
2mo ago javascript intermediate
Prototype Chain Errors & hasOwnProperty ES2022
Iterating objects with for...in includes inherited prototype properties — use hasOwnProperty() or Object.keys() to iterate only own properties.
2mo ago javascript intermediate
Temporal Dead Zone (TDZ) ES2015
let and const variables exist in a Temporal Dead Zone from the start of their block until their declaration — accessing them before throws ReferenceError.
2mo ago javascript intermediate
Type Coercion Gotchas (== vs ===) ES5
JavaScript's == performs type coercion producing surprising results — '0' == false (true), [] == false (true), null == undefined (true) — use === always.
2mo ago javascript intermediate
Unhandled Promise Rejection ES2015
An unhandled Promise rejection occurs when a rejected Promise has no .catch() or try/catch handler — Node.js 15+ terminates the process on unhandled rejection by default.
2mo ago javascript intermediate
AbortController — Cancellable Fetch ES2017
AbortController cancels in-flight fetch requests — essential for search-as-you-type, tab switching, and preventing race conditions in PHP API calls.
2mo ago javascript intermediate
AJAX Patterns for PHP Backends ES2017
Patterns for communicating with PHP backends via fetch — JSON APIs, CSRF tokens, error handling, and response parsing.
2mo ago javascript intermediate
Axios — HTTP Client for PHP APIs ES2015
Axios is a promise-based HTTP client with interceptors, automatic JSON parsing, and CSRF token injection — common in Laravel and Symfony frontends.
2mo ago javascript intermediate
Client-Side Sanitisation ES2015
DOMPurify and the Sanitizer API remove dangerous HTML before insertion — complementing PHP's server-side htmlspecialchars for rich-text scenarios.
2mo ago javascript intermediate
CSRF Token Handling in Fetch & Axios ES2017
Including PHP-generated CSRF tokens in JavaScript requests — reading from meta tags or cookies and attaching to every state-changing request.
2mo ago javascript intermediate
ES6 Class Syntax ES2015
ES6 classes are syntactic sugar over prototypal inheritance — the keywords mirror PHP but the underlying mechanism is different.
2mo ago javascript intermediate
File API — FileReader & File Input ES2015
File and FileReader provide client-side access to user-selected files before upload to PHP — enabling preview, validation, and chunked upload.
2mo ago javascript intermediate
FormData API ES2015
FormData constructs key-value pairs from HTML forms for AJAX submission to PHP backends — supports file uploads without page reload.
2mo ago javascript intermediate
Global Error Handling in JavaScript ES2017
window.onerror and unhandledrejection catch uncaught errors globally — essential for logging client-side errors back to PHP for monitoring.
2mo ago javascript intermediate
History API — SPA Routing with PHP Backend HTML5
history.pushState and popstate enable URL changes without page reload — used for SPA routing while keeping PHP as the backend.
2mo ago javascript intermediate
JavaScript Bundling — Vite, Webpack, esbuild ES2015
Bundlers combine JS modules into optimised files served by PHP — Vite for dev speed, Webpack for complex pipelines, esbuild for raw performance.
2mo ago javascript intermediate
Reactive Patterns — Observer & Pub/Sub in JavaScript ES2015
EventEmitter, CustomEvent, and pub/sub patterns coordinate state changes across components without tight coupling — common in PHP-rendered pages with JS islands.
2mo ago javascript intermediate
Custom Events & EventTarget API ES2015
Creating and dispatching custom DOM events for decoupled component communication — alternatives to direct function calls and third-party event emitters.
2mo ago javascript intermediate
✓ schema.org compliant