Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
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.
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).
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 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 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 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 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.
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 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.
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 Fetch API: GET, POST, response.ok, Timeouts and an Intro to CORS
We fetch and send data with the Fetch API and see why a 404 skips catch, how response.ok helps, POST/PUT/DELETE, timeouts with AbortSignal.timeout, CORS, and showing loading and error states.
Advanced DOM in JavaScript: Navigation, closest, dataset, template and Batched Updates
We navigate the DOM with parent, children, siblings and closest, use dataset, insertAdjacentHTML, DocumentFragment, template, cloneNode and getBoundingClientRect, then meet reflow and batch our updates.