Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
JavaScript RegEx Basics: Searching and Validating Text with Regular Expressions
We use test, match, matchAll and replace with regular expressions, learn character classes, quantifiers, groups and the g, i and m flags, write email, phone and postal code checks and meet RegExp.escape.
JavaScript Date Basics: Creating, Calculating and Formatting Dates
We see that a Date is really a timestamp, then learn how to create dates, the zero-based month trap, get/set methods, the difference between two dates and formatting with toLocaleDateString and Intl.DateTimeFormat.
The JavaScript BOM: window, location, navigator and Timers
We get to know the browser objects: the global window, location for the address, navigating with history, navigator and screen info, timers with setTimeout and setInterval, and why alert, confirm and prompt are rarely used.
JavaScript Forms: Reading Values, Handling Submit and Simple Validation
We read form values with value, checked and selectedIndex, catch the submit event, write checks for empty fields, email and length, show errors on the page and get to know HTML's built-in validation.
JavaScript Events: Handling Clicks, Keyboard and Input with addEventListener
We listen to click, input, keydown and submit events with addEventListener, and learn about target and key on the event object, preventDefault, removeEventListener and why inline onclick is discouraged.
Intro to the JavaScript DOM: Selecting, Changing and Creating Elements
We meet the DOM tree the browser builds from HTML, select elements with querySelector, see why textContent and innerHTML differ and what XSS is, then change the page live with classList and createElement.
JavaScript JSON: JSON.stringify, JSON.parse, try/catch and Deep Copies
We learn JSON's syntax rules, indentation and replacers with JSON.stringify, which values get lost, JSON.parse and revivers, catching broken JSON with try/catch, and why structuredClone wins for deep copies.
JavaScript Objects: Object Literals, Properties, Object.keys and structuredClone
We learn object literals, property access with dots and brackets, nested objects, methods and this, in and Object.keys/values/entries, for...in, shallow copies with spread and deep copies with structuredClone.
JavaScript Functions: Declarations, Arrow Functions, Parameters and return
We learn function declarations, expressions and arrow functions, parameters and arguments, default parameters, return, passing functions as callbacks, function scope and how to write good functions.
JavaScript Arrays: push, pop, slice, splice, Spread and the sort Trap
We learn how to create arrays, access them with at(), push/pop/shift/unshift, slice vs splice, copying with spread, forEach, why sort gets numbers wrong, and the reference trap.
JavaScript Number and Math: 0.1 + 0.2, Number Conversion, Random Numbers and Formatting
We learn JavaScript's single number type, the 0.1 + 0.2 precision issue, Number vs parseInt, NaN and bigint, rounding and random numbers with Math, and currency formatting with Intl.NumberFormat.
JavaScript Strings: Template Literals, String Methods and Immutability
From quote types and template literals to at(), slice, includes, replaceAll, split and padStart, we learn how strings work, why they are immutable, and the Turkish İ and emoji length traps.