Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
JavaScript async/await: Readable Async Code, Error Handling and Waiting in Parallel
We see why async functions always return promises, how await waits without freezing the page, catching errors with try/catch, sequential versus parallel waiting, the await-in-a-loop trap and top-level await.
JavaScript Promises: Three States, the then/catch/finally Chain and Error Propagation
We build the three promise states with a restaurant buzzer analogy and work through new Promise, then/catch/finally, chaining, error propagation, Promise.all and race, and wrapping callbacks.
Intro to Asynchronous JavaScript: The Call Stack, the Event Loop and Callbacks
We see how single-threaded JavaScript handles waiting without freezing the page through the call stack, Web APIs, the callback queue and the event loop, and unpack setTimeout(fn, 0) and callback hell.
JavaScript Classes: Constructor, Getters/Setters, Static and Private Fields
We build class syntax with a cookie-cutter analogy and work through constructors, getters/setters, static members, # private fields, extends and super, then see that a class is really prototypes underneath.
JavaScript Error Handling: try/catch, Custom Error Classes and Error Chains with cause
We learn try/catch/finally and throw, the built-in error types, writing your own error class with extends Error, error chains with ES2022's cause, Error.isError (not in Safari yet) and showing errors to users properly.
JavaScript Map and Set: Key-Value Collections and the New Set Methods
We learn how Map differs from objects, unique values with Set, iteration, set operations such as union and intersection from ES2025, and ES2026's getOrInsert, with a quick look at WeakMap.
JavaScript this, call, apply and bind: How Is the Value of this Decided?
We learn how this is decided by the way a function is called, the lost method trap, the this of arrow functions, setting this with call, apply and bind, this in event handlers, and partial application with bind.
JavaScript Scope, Hoisting and Closures: Where Do Variables Live?
We learn global, function and block scope, the scope chain, how var, let, const and functions are hoisted, the TDZ, and closures through counters, private data and function factories, plus the closure-in-a-loop trap.
JavaScript Array Methods in Depth: map, filter, reduce, toSorted and Object.groupBy
We make sense of map, filter, reduce, the find family, some/every and flatMap with an assembly line analogy, then try the non-mutating toSorted and with (ES2023) and grouping with Object.groupBy (ES2024).
Modern JavaScript Syntax: Destructuring, Spread/Rest, Optional Chaining and Logical Assignment
We learn array and object destructuring, the difference between spread and rest, shorthand and computed properties, ?. with ??, and the ||=, &&= and ??= operators, along with the ES edition each came from.
TypeScript in the Browser: DOM Types, querySelector and Events
We look at the lib.dom types, what querySelector returns and its generic form, element types like HTMLInputElement, event types and the event.target trap, then run tsc output on a page as a module script.
tsconfig Basics: TypeScript 7 Defaults and Removed Options
We go through the strict family, target, lib, types, module, outDir and rootDir, erasableSyntaxOnly and verbatimModuleSyntax, the TypeScript 6/7 defaults and the options removed in 7.0.