JavaScript Guide

Language internals, runtime, frameworks — how things work at code level

🌐 Browser APIs

👷

Web Workers — How to Use Multi-Threading in JavaScript

Structured Clone of postMessage and SharedArrayBuffer

Web Workers run JavaScript on a separate thread from main. No DOM access, communicate via postMessage. Offload heavy computation to Workers to keep UI responsive.

⚡

Service Worker Lifecycle — The Order of install, activate, fetch

The core of PWA — how offline caching works

Service Workers act as proxies between browser and network. Lifecycle: install → activate → fetch. Cache API stores resources for offline app functionality.

👁️

Intersection Observer — Detect Element Visibility Without Scroll Events

Performance-friendly implementation for lazy loading, infinite scroll, animation triggers

Intersection Observer fires callbacks when elements enter/exit the viewport. Better performance than scroll events + getBoundingClientRect(), executed at browser-optimized timing.

💬

Popover API — Why You Can Now Build Tooltips Without JavaScript

A single popover attribute handles open/close, Esc dismissal, and accessibility automatically

Traditional tooltips required event listeners, state management, and manual ARIA synchronization. The Popover API replaces all of that natively. Just popover and popovertarget attributes handle open/close, Esc key, and keyboard navigation automatically.

💬

Popover API — What Browser-Native Tooltips Actually Change

Replace JS event listeners, manual ARIA sync, and state management with two HTML attributes

Before Popover API, a single tooltip required event listeners, state tracking, and manual ARIA sync. The popover and popovertarget attributes handle open/close, Esc key, and focus restoration automatically.