Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
JavaScript Memory Management: Garbage Collection, Memory Leaks and WeakRef
We look at the stack and heap, reachability and garbage collection, then cover leaks from forgotten listeners, timers, closures and detached DOM, plus WeakMap, WeakRef and heap snapshots in DevTools.
JavaScript Proxy and Reflect: Traps, Validation and Reactivity
We intercept reads, writes and deletes on an object with Proxy and keep default behavior with Reflect, then build validation, default values and a reactive UI while covering the pitfalls and the cost.
JavaScript Async Iterators: for await...of, Async Generators and Array.fromAsync
We walk through data that arrives over time with Symbol.asyncIterator and async generators, learn for await...of and ES2026's Array.fromAsync, read a paginated API as a stream and meet ReadableStream.
JavaScript Iterators and Generators: Symbol.iterator, yield and Iterator Helpers
We cover the iterable and iterator protocols, writing your own iterable with Symbol.iterator, how generators and yield pause and resume, infinite sequences, ES2025 iterator helpers and ES2026's Iterator.concat.
Advanced JavaScript Async Patterns: The Promise.all Family, Cancellation, Retry and Timeouts
We look at the differences between Promise.all, allSettled, any and race, ES2024's Promise.withResolvers, ES2025's Promise.try, supporting AbortSignal in your own functions, retry, timeouts and concurrency limits.
The JavaScript Event Loop in Depth: Tasks, Microtasks and Rendering Order
We work through output-order puzzles to see the task and microtask queues, where promises and queueMicrotask fit, when requestAnimationFrame runs in the rendering step, and why long tasks freeze the page.
JavaScript OOP Patterns: Inheritance or Composition? Factory Functions and Mixins
We talk about the cost of inheritance, combining behavior with composition, factory functions and mixins, choosing between closures and #private, the SOLID principles that fit JavaScript, and when a class is worth writing.
JavaScript Object Protection and Immutability: Property Descriptors, seal and freeze
We look at property descriptors, the sneaky defaults of Object.defineProperty, the difference between preventExtensions, seal and freeze, shallow versus deep freezing, and patterns for updating objects without mutating them.
The JavaScript Prototype Chain: How Objects Inherit from Each Other
We untangle the [[Prototype]] link, property lookup along the chain, __proto__ versus Object.getPrototypeOf, constructor functions, Object.create and the prototype machinery underneath class, step by step in the console.
TypeScript Declaration Files: .d.ts, @types, declare and Global Augmentation
We look at what .d.ts files are, @types and DefinitelyTyped, writing your own declarations with declare module, ambient declarations, global augmentation with declare global, and generating .d.ts with declaration: true.
TypeScript Enums, Namespaces and Parameter Properties: Syntax That Isn't Erasable
We examine numeric and string enums, const enum, namespaces and parameter properties through their compiled output, and see why they aren't erasable, erasableSyntaxOnly, and the as const alternative.
Error Handling in TypeScript: unknown in catch, Narrowing Errors and the Result Pattern
We look at why the catch variable is unknown, narrowing with instanceof Error, custom error classes, Promise pitfalls, and modeling errors with Result and discriminated unions.