[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"verticals":3,"quiz-no-unchecked-indexed-access":44,"search-suggestions":60,"quiz-article-no-unchecked-indexed-access":109,"path-membership-no-unchecked-indexed-access":298},[4,20,32],{"id":5,"slug":6,"name":7,"tagline":8,"description":9,"accentFrom":10,"accentTo":11,"icon":12,"defaultLocale":13,"locales":14,"features":16,"position":19},"019fe637-3d33-714b-b57f-23e163ffca0c","dev","Web Development","Read it. Run it. Prove it.","A post a day on modern web development — most with an editable playground and a quiz that explains every answer. Free, no account needed.","violet-500","cyan-400","◇","en",[13,15],"fa",{"courses":17,"paths":17,"articles":17,"exams":18,"flashcards":18,"packages":17,"community":17,"certificates":17,"teams":17,"commerce":17},true,false,0,{"id":21,"slug":22,"name":23,"tagline":24,"description":25,"accentFrom":26,"accentTo":10,"icon":27,"defaultLocale":13,"locales":28,"features":30,"position":31},"019fe637-3dc2-754c-8657-0f175bfee7c6","lang","Languages","Learn a language the way you learn a codebase.","Grammar explained the way good documentation explains an API — one idea at a time, each with a quiz.","amber-400","⌘",[13,15,29],"es",{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":17,"packages":18,"community":17,"certificates":17,"teams":18,"commerce":18},2,{"id":33,"slug":34,"name":35,"tagline":36,"description":37,"accentFrom":38,"accentTo":39,"icon":40,"defaultLocale":13,"locales":41,"features":42,"position":43},"7b3c16f2-931d-410e-802e-e1fa4edab7de","soft","Soft Skills","The half of the job nobody wrote documentation for.","Weekly, on the parts of working life that decide more than your code does — first weeks, meetings, interviews, promotions, and the people around you. Written from what actually happens, and recorded as a podcast you can listen to on the walk.","emerald-400","teal-300","◉",[13],{"courses":18,"paths":18,"articles":17,"exams":18,"flashcards":18,"packages":18,"community":17,"certificates":18,"teams":18,"commerce":18},3,{"id":45,"slug":46,"kind":47,"title":48,"description":49,"config":50,"verticalId":5,"vertical":55,"course":52,"_count":56,"access":57,"attempts":59,"questionCount":51},"01a1df1b-2cb1-72fc-bbb6-4c8cc93f11d9","no-unchecked-indexed-access","PRACTICE_QUIZ","noUncheckedIndexedAccess — test yourself","Seven questions on what the noUncheckedIndexedAccess compiler flag actually changes, what it leaves alone, and why silencing its errors with `!` brings the original bug back.",{"questionCount":51,"timeLimitSec":52,"shuffleQuestions":18,"shuffleOptions":17,"negativeMarking":19,"passScorePct":53,"maxAttempts":52,"revealAnswers":54,"allowFlagging":18,"allowBacktracking":17},7,null,70,"AFTER_SUBMIT",{"slug":6,"name":7},{"questions":51},{"allowed":17,"reason":58},"FREE",[],[61,65,69,73,77,81,85,89,93,97,101,105],{"slug":62,"name":63,"articles":64},"webdev","Webdev",195,{"slug":66,"name":67,"articles":68},"javascript","Javascript",156,{"slug":70,"name":71,"articles":72},"frontend","Frontend",103,{"slug":74,"name":75,"articles":76},"tutorial","Tutorial",85,{"slug":78,"name":79,"articles":80},"css","Css",56,{"slug":82,"name":83,"articles":84},"typescript","Typescript",36,{"slug":86,"name":87,"articles":88},"performance","Performance",33,{"slug":90,"name":91,"articles":92},"programming","Programming",26,{"slug":94,"name":95,"articles":96},"react","React",23,{"slug":98,"name":99,"articles":100},"node","Node",19,{"slug":102,"name":103,"articles":104},"browser","Browser",18,{"slug":106,"name":107,"articles":108},"nextjs","Nextjs",13,{"id":110,"slug":46,"title":111,"subtitle":52,"excerpt":112,"coverUrl":113,"locale":13,"readingMinutes":114,"publishedAt":115,"viewCount":116,"likeCount":19,"commentCount":19,"author":117,"vertical":122,"topic":123,"tags":125,"_count":130,"playground":132,"body":134,"bodyMd":285,"seo":286,"translationGroupId":288,"series":52,"podcastUrl":52,"verticalId":5,"thread":289,"assessments":291,"translations":294,"quiz":296},"01a1df1b-2c58-7318-b1ea-6c6fcef9ff05","arr[i] Isn't Always There. noUncheckedIndexedAccess Says So.","TypeScript types arr[i] as T, never T | undefined — even though the array might be empty. The noUncheckedIndexedAccess flag makes bracket indexing tell the truth.","\u002Fmedia\u002Fcovers\u002Fno-unchecked-indexed-access.png",5,"2026-11-27T11:44:26.334Z",17,{"id":118,"name":119,"username":120,"avatarUrl":52,"headline":121},"019fe637-3c25-7088-9034-39c9f15dc3c8","Parsa Jiravand","parsa","Frontend engineer · building bestpractic",{"slug":6,"name":7,"accentFrom":10,"accentTo":11},{"slug":82,"name":124},"TypeScript",[126,127,128,129],{"slug":82,"name":83,"color":52},{"slug":66,"name":67,"color":52},{"slug":62,"name":63,"color":52},{"slug":90,"name":91,"color":52},{"assessments":131},1,{"slug":46,"title":133},"noUncheckedIndexedAccess — interactive playground",{"blocks":135,"version":131},[136,140,146,149,152,157,160,164,167,170,174,177,180,184,189,192,196,199,202,205,208,212,215,218,221,224,227,230,233,236,239,242,245,248,251,254,257,260,267,270,273,276,279],{"id":137,"html":138,"type":139},"b1","\u003Cp>Three lines of TypeScript. Same shape, same compiler, same \u003Ccode>strict: true\u003C\u002Fcode>.\u003C\u002Fp>","paragraph",{"id":141,"code":142,"type":143,"language":144,"highlight":145},"b2","const user = users.find(u => u.id === id);  \u002F\u002F User | undefined\nconst user2 = userMap.get(id);               \u002F\u002F User | undefined\nconst user3 = usersById[id];                 \u002F\u002F User","code","ts",[],{"id":147,"html":148,"type":139},"b3","\u003Cp>The first two make you prove the user exists before you touch \u003Ccode>.name\u003C\u002Fcode>. The third doesn&#39;t. It&#39;s typed as a plain \u003Ccode>User\u003C\u002Fcode> — no \u003Ccode>| undefined\u003C\u002Fcode>, no error, no hint that anything could go wrong. Ship it, and the one time \u003Ccode>id\u003C\u002Fcode> doesn&#39;t match a key, you get \u003Ccode>Cannot read properties of undefined (reading &#39;name&#39;)\u003C\u002Fcode> in production, from a line TypeScript signed off on.\u003C\u002Fp>",{"id":150,"html":151,"type":139},"b4","\u003Cp>That&#39;s not a fluke in one lib&#39;s types. It&#39;s the default behavior of \u003Ccode>[]\u003C\u002Fcode>.\u003C\u002Fp>",{"id":153,"html":154,"text":155,"type":156,"level":31},"b5","The obvious fix that doesn&#39;t fix it","The obvious fix that doesn't fix it","heading",{"id":158,"html":159,"type":139},"b6","\u003Cp>Say your team hits this bug, traces it back, and &quot;fixes&quot; the type:\u003C\u002Fp>",{"id":161,"code":162,"type":143,"language":144,"highlight":163},"b7","type UsersById = Record\u003Cstring, User>;\nconst usersById: UsersById = buildIndex(users);\n\nconst user3 = usersById[id];\nuser3.name; \u002F\u002F still typed `User`, still no warning",[],{"id":165,"html":166,"type":139},"b8","\u003Cp>Nothing changes. \u003Ccode>Record&lt;string, User&gt;\u003C\u002Fcode> tells TypeScript that \u003Cem>every\u003C\u002Fem> string key maps to a \u003Ccode>User\u003C\u002Fcode> — which is exactly the lie that caused the bug. An index signature isn&#39;t a promise about what&#39;s actually in the object; it&#39;s a promise about what \u003Cem>could\u003C\u002Fem> be, and TypeScript takes it at face value for every key you ask for, including ones you made up at runtime from user input, a URL param, or a cache miss.\u003C\u002Fp>",{"id":168,"html":169,"type":139},"b9","\u003Cp>So the team does what teams do under a ticket deadline: they start writing \u003Ccode>usersById[id]!.name\u003C\u002Fcode>. The \u003Ccode>!\u003C\u002Fcode> tells the compiler &quot;trust me, it&#39;s there.&quot; It compiles. It ships. It&#39;s the exact same crash, now with the compiler&#39;s blessing instead of its silence.\u003C\u002Fp>",{"id":171,"html":172,"text":173,"type":156,"level":31},"b10","What&#39;s actually going on","What's actually going on",{"id":175,"html":176,"type":139},"b11","\u003Cp>\u003Ccode>arr[i]\u003C\u002Fcode> and \u003Ccode>obj[key]\u003C\u002Fcode> are \u003Cstrong>indexed access\u003C\u002Fstrong>, and TypeScript treats indexed access as a guarantee by default: give it a key of the right type, get back a value of the value type, full stop. It doesn&#39;t matter that \u003Ccode>i\u003C\u002Fcode> could be \u003Ccode>arr.length\u003C\u002Fcode> or that \u003Ccode>key\u003C\u002Fcode> could be a string nobody ever inserted — the type signature only describes the shape of a successful lookup, never the possibility of a missing one.\u003C\u002Fp>",{"id":178,"html":179,"type":139},"b12","\u003Cp>Compare that to \u003Ccode>Array.prototype.at()\u003C\u002Fcode>, which TypeScript&#39;s own lib types declare as \u003Ccode>at(index: number): T | undefined\u003C\u002Fcode> — not because of any special flag, just because that method&#39;s type was written honestly from the start. Or \u003Ccode>Map.get()\u003C\u002Fcode>, typed \u003Ccode>V | undefined\u003C\u002Fcode> for the same reason. Those two already tell you the truth. Bracket indexing is the one place TypeScript picked optimism over accuracy, and it&#39;s been that way since index signatures existed — \u003Ccode>strict: true\u003C\u002Fcode> never touched it.\u003C\u002Fp>",{"id":181,"html":182,"text":183,"type":156,"level":31},"b13","The fix that&#39;s actually a compiler flag","The fix that's actually a compiler flag",{"id":185,"code":186,"type":143,"language":187,"highlight":188},"b14","\u002F\u002F tsconfig.json\n{\n  \"compilerOptions\": {\n    \"noUncheckedIndexedAccess\": true\n  }\n}","jsonc",[],{"id":190,"html":191,"type":139},"b15","\u003Cp>Flip this on (it shipped in TypeScript 4.1, and it is \u003Cem>not\u003C\u002Fem> bundled into \u003Ccode>strict\u003C\u002Fcode>, so turning on strict mode alone will never give you this) and both lines above change shape:\u003C\u002Fp>",{"id":193,"code":194,"type":143,"language":144,"highlight":195},"b16","const user3 = usersById[id];        \u002F\u002F User | undefined\nconst n = someArray[i];              \u002F\u002F T | undefined\nconst t: [string, number] = [...];\nconst first = t[0];                  \u002F\u002F still `string` — fixed tuple positions are exempt",[],{"id":197,"html":198,"type":139},"b17","\u003Cp>Notice what \u003Cem>doesn&#39;t\u003C\u002Fem> change: a tuple with a literal, in-bounds index stays exact, because TypeScript can actually verify that position exists at compile time. The flag only widens the cases where it can&#39;t — variable array indices and index-signature lookups — which is precisely where the runtime risk lives.\u003C\u002Fp>",{"id":200,"html":201,"text":201,"type":156,"level":31},"b18","Turning it on is the easy part",{"id":203,"html":204,"type":139},"b19","\u003Cp>The honest downside: flip this in an existing codebase and you&#39;ll likely get a wave of new &quot;possibly undefined&quot; errors, all at once, in code that worked yesterday. That&#39;s not the flag being noisy. That&#39;s every place your code was already one bad lookup away from the same crash, surfacing at once instead of one ticket at a time.\u003C\u002Fp>",{"id":206,"html":207,"type":139},"b20","\u003Cp>Resist the urge to \u003Ccode>!\u003C\u002Fcode> your way through the list. Each one wants a real answer, and the right one depends on where you are in the code:\u003C\u002Fp>",{"id":209,"code":210,"type":143,"language":144,"highlight":211},"b21","\u002F\u002F You can supply a sane fallback\nconst label = tags[0] ?? 'untagged';\n\n\u002F\u002F You're about to use it repeatedly — narrow once\nconst user3 = usersById[id];\nif (!user3) return notFound();\nuser3.name; \u002F\u002F User, safely\n\n\u002F\u002F You actually know more than the type system does\n\u002F\u002F (a loop invariant, a length check two lines up) — rare, and worth a comment\nconst first = items[0]!; \u002F\u002F items.length checked above",[],{"id":213,"html":214,"type":139},"b22","\u003Cp>The \u003Ccode>!\u003C\u002Fcode> isn&#39;t banned — it&#39;s just supposed to be the least common answer, reserved for the handful of spots where you can point at \u003Cem>why\u003C\u002Fem> it&#39;s safe. If every possibly-undefined error in your list gets the same \u003Ccode>!\u003C\u002Fcode>, you haven&#39;t fixed anything; you&#39;ve just moved the crash from &quot;silent&quot; to &quot;asserted.&quot;\u003C\u002Fp>",{"id":216,"html":217,"type":139},"b23","\u003C!-- playground:start -->",{"id":219,"html":220,"text":220,"type":156,"level":31},"b24","🎮 Try it yourself",{"id":222,"html":223,"type":139},"b25","\u003Cp>\u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fno-unchecked-indexed-access\u002Fplayground\">▶️ Open the interactive playground →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":225,"html":226,"type":139},"b26","\u003Cp>\u003Cem>Runs right in your browser — poke at it and watch the concept react live.\u003C\u002Fem>\u003C\u002Fp>",{"id":228,"html":229,"type":139},"b27","\u003C!-- playground:end -->",{"id":231,"html":232,"text":232,"type":156,"level":31},"b28","The one-line trust exercise",{"id":234,"html":235,"type":139},"b29","\u003Cp>\u003Ccode>noUncheckedIndexedAccess\u003C\u002Fcode> doesn&#39;t change a single byte of your compiled JavaScript. The runtime behavior of \u003Ccode>arr[i]\u003C\u002Fcode> was never in question — it was always capable of returning \u003Ccode>undefined\u003C\u002Fcode>. All the flag does is make the type checker stop pretending otherwise, for the one kind of access it had been quietly exempting from its own rules.\u003C\u002Fp>",{"id":237,"html":238,"type":139},"b30","\u003Cp>If your \u003Ccode>tsconfig.json\u003C\u002Fcode> doesn&#39;t have it yet, that&#39;s worth fixing before the next \u003Ccode>usersById[id]\u003C\u002Fcode> ships. What&#39;s the last production error you traced back to a lookup TypeScript swore couldn&#39;t fail?\u003C\u002Fp>",{"id":240,"html":241,"type":139},"b31","\u003C!-- quiz:start -->",{"id":243,"html":244,"text":244,"type":156,"level":31},"b32","🧠 Test yourself",{"id":246,"html":247,"type":139},"b33","\u003Cp>Think it clicked? \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fno-unchecked-indexed-access\u002Fquiz\">Take the 7-question quiz →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":249,"html":250,"type":139},"b34","\u003Cp>\u003Cem>Instant feedback, a hint on every question, and an explanation for each answer — right or wrong.\u003C\u002Fem>\u003C\u002Fp>",{"id":252,"html":253,"type":139},"b35","\u003C!-- quiz:end -->",{"id":255,"html":256,"type":139},"b36","\u003C!-- related:start -->",{"id":258,"html":259,"text":259,"type":156,"level":31},"b37","📚 Read next",{"id":261,"type":262,"items":263,"ordered":18},"b38","list",[264,265,266],"\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fintl-numberformat-currency-formatting\">Stop Formatting Currency With Regex. \u003Ccode>Intl.NumberFormat\u003C\u002Fcode> Does It.\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Finferred-type-predicates-filter-boolean\">Inferred Type Predicates Won&#39;t Save filter(Boolean). Here&#39;s What Will.\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Ftemporal-api-date-mutation-trap\">addDays() Mutated a Date Three Components Away From Where I Called It\u003C\u002Fa>",{"id":268,"html":269,"type":139},"b39","\u003C!-- related:end -->",{"id":271,"type":272},"b40","divider",{"id":274,"html":275,"type":139},"b41","\u003Cp>🚀 \u003Cstrong>Want more like this?\u003C\u002Fstrong> Every guide, playground, and quiz lives on \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">bestpractic.org\u003C\u002Fa>\u003C\u002Fstrong> — open it and \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">sign up free\u003C\u002Fa>\u003C\u002Fstrong> so the next one finds you.\u003C\u002Fp>",{"id":277,"html":278,"type":139},"b42","\u003Cp>\u003Cem>Thanks for reading! Let&#39;s stay connected:\u003C\u002Fem>\u003C\u002Fp>",{"id":280,"type":262,"items":281,"ordered":18},"b43",[282,283,284],"⭐ \u003Cstrong>GitHub\u003C\u002Fstrong> — follow me and star the projects: \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fparsajiravand\">github.com\u002Fparsajiravand\u003C\u002Fa>","💬 \u003Cstrong>Discord\u003C\u002Fstrong> — join the frontend best-practices community: \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ\">discord.gg\u002Fd9KRhuAwQ\u003C\u002Fa>","📸 \u003Cstrong>Instagram\u003C\u002Fstrong> — frontend best practices, daily: \u003Ca href=\"https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F\">@bestpractice___\u003C\u002Fa>","Three lines of TypeScript. Same shape, same compiler, same `strict: true`.\n\n```ts\nconst user = users.find(u => u.id === id);  \u002F\u002F User | undefined\nconst user2 = userMap.get(id);               \u002F\u002F User | undefined\nconst user3 = usersById[id];                 \u002F\u002F User\n```\n\nThe first two make you prove the user exists before you touch `.name`. The third doesn't. It's typed as a plain `User` — no `| undefined`, no error, no hint that anything could go wrong. Ship it, and the one time `id` doesn't match a key, you get `Cannot read properties of undefined (reading 'name')` in production, from a line TypeScript signed off on.\n\nThat's not a fluke in one lib's types. It's the default behavior of `[]`.\n\n## The obvious fix that doesn't fix it\n\nSay your team hits this bug, traces it back, and \"fixes\" the type:\n\n```ts\ntype UsersById = Record\u003Cstring, User>;\nconst usersById: UsersById = buildIndex(users);\n\nconst user3 = usersById[id];\nuser3.name; \u002F\u002F still typed `User`, still no warning\n```\n\nNothing changes. `Record\u003Cstring, User>` tells TypeScript that *every* string key maps to a `User` — which is exactly the lie that caused the bug. An index signature isn't a promise about what's actually in the object; it's a promise about what *could* be, and TypeScript takes it at face value for every key you ask for, including ones you made up at runtime from user input, a URL param, or a cache miss.\n\nSo the team does what teams do under a ticket deadline: they start writing `usersById[id]!.name`. The `!` tells the compiler \"trust me, it's there.\" It compiles. It ships. It's the exact same crash, now with the compiler's blessing instead of its silence.\n\n## What's actually going on\n\n`arr[i]` and `obj[key]` are **indexed access**, and TypeScript treats indexed access as a guarantee by default: give it a key of the right type, get back a value of the value type, full stop. It doesn't matter that `i` could be `arr.length` or that `key` could be a string nobody ever inserted — the type signature only describes the shape of a successful lookup, never the possibility of a missing one.\n\nCompare that to `Array.prototype.at()`, which TypeScript's own lib types declare as `at(index: number): T | undefined` — not because of any special flag, just because that method's type was written honestly from the start. Or `Map.get()`, typed `V | undefined` for the same reason. Those two already tell you the truth. Bracket indexing is the one place TypeScript picked optimism over accuracy, and it's been that way since index signatures existed — `strict: true` never touched it.\n\n## The fix that's actually a compiler flag\n\n```jsonc\n\u002F\u002F tsconfig.json\n{\n  \"compilerOptions\": {\n    \"noUncheckedIndexedAccess\": true\n  }\n}\n```\n\nFlip this on (it shipped in TypeScript 4.1, and it is *not* bundled into `strict`, so turning on strict mode alone will never give you this) and both lines above change shape:\n\n```ts\nconst user3 = usersById[id];        \u002F\u002F User | undefined\nconst n = someArray[i];              \u002F\u002F T | undefined\nconst t: [string, number] = [...];\nconst first = t[0];                  \u002F\u002F still `string` — fixed tuple positions are exempt\n```\n\nNotice what *doesn't* change: a tuple with a literal, in-bounds index stays exact, because TypeScript can actually verify that position exists at compile time. The flag only widens the cases where it can't — variable array indices and index-signature lookups — which is precisely where the runtime risk lives.\n\n## Turning it on is the easy part\n\nThe honest downside: flip this in an existing codebase and you'll likely get a wave of new \"possibly undefined\" errors, all at once, in code that worked yesterday. That's not the flag being noisy. That's every place your code was already one bad lookup away from the same crash, surfacing at once instead of one ticket at a time.\n\nResist the urge to `!` your way through the list. Each one wants a real answer, and the right one depends on where you are in the code:\n\n```ts\n\u002F\u002F You can supply a sane fallback\nconst label = tags[0] ?? 'untagged';\n\n\u002F\u002F You're about to use it repeatedly — narrow once\nconst user3 = usersById[id];\nif (!user3) return notFound();\nuser3.name; \u002F\u002F User, safely\n\n\u002F\u002F You actually know more than the type system does\n\u002F\u002F (a loop invariant, a length check two lines up) — rare, and worth a comment\nconst first = items[0]!; \u002F\u002F items.length checked above\n```\n\nThe `!` isn't banned — it's just supposed to be the least common answer, reserved for the handful of spots where you can point at *why* it's safe. If every possibly-undefined error in your list gets the same `!`, you haven't fixed anything; you've just moved the crash from \"silent\" to \"asserted.\"\n\n\u003C!-- playground:start -->\n\n## 🎮 Try it yourself\n\n**[▶️ Open the interactive playground →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fno-unchecked-indexed-access\u002Fplayground)**\n\n_Runs right in your browser — poke at it and watch the concept react live._\n\n\u003C!-- playground:end -->\n\n## The one-line trust exercise\n\n`noUncheckedIndexedAccess` doesn't change a single byte of your compiled JavaScript. The runtime behavior of `arr[i]` was never in question — it was always capable of returning `undefined`. All the flag does is make the type checker stop pretending otherwise, for the one kind of access it had been quietly exempting from its own rules.\n\nIf your `tsconfig.json` doesn't have it yet, that's worth fixing before the next `usersById[id]` ships. What's the last production error you traced back to a lookup TypeScript swore couldn't fail?\n\n\u003C!-- quiz:start -->\n\n## 🧠 Test yourself\n\nThink it clicked? **[Take the 7-question quiz →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fno-unchecked-indexed-access\u002Fquiz)**\n\n_Instant feedback, a hint on every question, and an explanation for each answer — right or wrong._\n\n\u003C!-- quiz:end -->\n\n\u003C!-- related:start -->\n\n## 📚 Read next\n\n- [Stop Formatting Currency With Regex. `Intl.NumberFormat` Does It.](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fintl-numberformat-currency-formatting)\n- [Inferred Type Predicates Won't Save filter(Boolean). Here's What Will.](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Finferred-type-predicates-filter-boolean)\n- [addDays() Mutated a Date Three Components Away From Where I Called It](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Ftemporal-api-date-mutation-trap)\n\n\u003C!-- related:end -->\n\n---\n\n🚀 **Want more like this?** Every guide, playground, and quiz lives on **[bestpractic.org](https:\u002F\u002Fbestpractic.org\u002F)** — open it and **[sign up free](https:\u002F\u002Fbestpractic.org\u002F)** so the next one finds you.\n\n*Thanks for reading! Let's stay connected:*\n\n- ⭐ **GitHub** — follow me and star the projects: [github.com\u002Fparsajiravand](https:\u002F\u002Fgithub.com\u002Fparsajiravand)\n- 💬 **Discord** — join the frontend best-practices community: [discord.gg\u002Fd9KRhuAwQ](https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ)\n- 📸 **Instagram** — frontend best practices, daily: [@bestpractice___](https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F)",{"title":111,"canonical":287,"description":112},"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fno-unchecked-indexed-access","01a1df1b-2c58-7318-b1ea-7338d88030df",{"id":290,"locked":18},"01a1df1b-2c97-7308-ab68-ed9e25c7f6fe",[292],{"id":45,"slug":46,"title":48,"_count":293},{"questions":51},[295],{"locale":13,"slug":46},{"id":45,"slug":46,"title":48,"_count":297,"questionCount":51},{"questions":51},[]]