Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
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.