browse/

45 results
web/event-bubbling-why-clicking-a-button-also-clicks-its-parent.md Event bubbling: why clicking a button also clicks its parent You click a button inside a div, and both click handlers run. Why does the parent hear about something that happened to its child? Every… 5 min read · 13 Oct security/caesar-cipher-why-25-guesses-break-it-and-what-real-encryption-does-in.md Caesar cipher: why 25 guesses break it, and what real encryption does instead The Caesar cipher swaps each letter for one a fixed distance along the alphabet. Slide the key yourself, then play the attacker and break… 5 min read · 12 Oct networks/dns-lookups-why-a-website-is-slower-the-first-time-you-visit.md DNS lookups: why a website is slower the first time you visit Typing a name like www.example.com sets off a short chain of questions: a resolver asks a root server, then a .com server, then the… 5 min read · 11 Oct security/two-factor-codes-how-your-phone-and-a-website-agree-on-6-digits.md Two-factor codes: how your phone and a website agree on 6 digits Your phone shows a 6-digit code that changes every 30 seconds, yet it never talks to the website. How do both sides agree on the number?… 5 min read · 9 Oct tools/what-does-1-2-3-mean-in-package-json-version-rules-you-can-try.md What does ^1.2.3 mean in package.json? Version rules you can try Open any package.json and you'll see versions like `^4.17.21` or `~1.2.3`. That little symbol is a rule for which updates npm may install… 5 min read · 8 Oct networks/latency-vs-bandwidth-why-a-faster-plan-can-t-speed-up-a-small-page.md Latency vs bandwidth: why a faster plan can't speed up a small page You upgraded to a much faster internet plan, yet a small web page loads just as slowly. Why? Network speed is two different numbers… 5 min read · 8 Oct languages/why-does-5-3-give-53-in-javascript-type-coercion-step-by-step.md Why does "5" + 3 give "53" in JavaScript? Type coercion, step by step Why does `"5" + 3` give `"53"` while `"5" - 3` gives `2`? It is not random. JavaScript follows a short recipe called type coercion: it… 4 min read · 7 Oct software-design/refactoring-tidy-messy-code-without-breaking-it-using-tests-as-a-net.md Refactoring: tidy messy code without breaking it, using tests as a net Refactoring means changing how code is written without changing what it does, so the next person (often you) can read it. It sounds risky… 5 min read · 6 Oct networks/packets-why-the-internet-cuts-your-message-into-numbered-pieces.md Packets: why the internet cuts your message into numbered pieces When you send a message online, it never travels as one block. The internet cuts it into small packets, each with a label saying where it… 5 min read · 5 Oct web/what-is-json-edit-it-live-and-see-why-apis-are-so-strict-about-it.md What is JSON? Edit it live and see why APIs are so strict about it When an app asks a server for data, the reply has to travel as plain text. JSON is the format most web APIs use: six kinds of value… 5 min read · 4 Oct mobile/two-phones-one-note-what-happens-when-edits-collide-offline.md Two phones, one note: what happens when edits collide offline? Phones lose signal all the time, so good apps keep a local copy of your data and sync with a server later. But what happens when two… 5 min read · 3 Oct software-design/your-first-unit-test-catch-the-leap-year-bug-a-quick-check-misses.md Your first unit test: catch the leap-year bug a quick check misses A unit test is a tiny piece of code that checks another piece of code: you pick an input, write down the answer you expect, and let the… 5 min read · 3 Oct