KKitForma.

Language

EnglishEnglishTürkçeTurkishDeutschGermanTool unavailable · open catalogEspañolSpanishTool unavailable · open catalogFrançaisFrenchTool unavailable · open catalogPortuguêsPortugueseTool unavailable · open catalogItalianoItalianTool unavailable · open catalogNederlandsDutchTool unavailable · open catalogPolskiPolishTool unavailable · open catalogРусскийRussianTool unavailable · open catalogУкраїнськаUkrainianTool unavailable · open catalogSvenskaSwedishTool unavailable · open catalogNorskNorwegianTool unavailable · open catalogDanskDanishTool unavailable · open catalogSuomiFinnishTool unavailable · open catalogČeštinaCzechTool unavailable · open catalogRomânăRomanianTool unavailable · open catalogΕλληνικάGreekTool unavailable · open catalogالعربيةArabicTool unavailable · open catalogעבריתHebrewTool unavailable · open catalogفارسیPersianTool unavailable · open catalogاردوUrduTool unavailable · open catalogहिन्दीHindiTool unavailable · open catalogবাংলাBengaliTool unavailable · open catalogதமிழ்TamilTool unavailable · open catalogతెలుగుTeluguTool unavailable · open catalogमराठीMarathiTool unavailable · open catalogગુજરાતીGujaratiTool unavailable · open catalog简体中文Chinese SimplifiedTool unavailable · open catalog繁體中文Chinese TraditionalTool unavailable · open catalog日本語JapaneseTool unavailable · open catalog한국어KoreanTool unavailable · open catalogTiếng ViệtVietnameseTool unavailable · open catalogไทยThaiTool unavailable · open catalogBahasa IndonesiaIndonesianTool unavailable · open catalogBahasa MelayuMalayTool unavailable · open catalogFilipinoFilipinoTool unavailable · open catalogKiswahiliSwahiliTool unavailable · open catalogAfrikaansAfrikaansTool unavailable · open catalogMagyarHungarianTool unavailable · open catalogБългарскиBulgarianTool unavailable · open catalogHrvatskiCroatianTool unavailable · open catalogSrpskiSerbianTool unavailable · open catalogSlovenčinaSlovakTool unavailable · open catalogSlovenščinaSlovenianTool unavailable · open catalogLietuviųLithuanianTool unavailable · open catalogLatviešuLatvianTool unavailable · open catalogEestiEstonianTool unavailable · open catalogCatalàCatalanTool unavailable · open catalogEuskaraBasqueTool unavailable · open catalog
← All topics and search

JavaScript & TypeScript

Types, asynchronous code, modules and JavaScript runtime edge cases.

100 troubleshooting guides · Page 3 / 5

  1. Why does string indexing corrupt an emoji while building initials?

    Bracket indexing returns one UTF-16 code unit.

  2. Why does a global validation regex alternate true and false on identical input?

    The g and y flags retain lastIndex between calls.

  3. How do I search literal user text containing brackets and backslashes?

    Prefer includes for literal substring searches.

  4. Why does replacing a repeated placeholder update only the first occurrence?

    A string passed to replace matches once.

  5. Why does a replacement containing $& unexpectedly duplicate matched text?

    Replacement strings interpret special dollar patterns.

  6. Why does splitting on a grouped delimiter include the delimiter in output?

    Capturing groups are included in split results.

  7. Is parsed JSON safe to merge into nested application settings?

    Parsing checks syntax, not allowed configuration keys.

  8. Why does structuredClone fail after a callback is added to my state?

    Functions are not supported by structured cloning.

  9. Why can I not list cached entries stored in a WeakMap?

    WeakMap exposes neither enumeration nor size because key lifetime depends on garbage collection.

  10. Why do all typed-array views stop working after transferring one buffer?

    Transferring the underlying ArrayBuffer detaches it from the sender, affecting every view over it.

  11. Why does deleting and re-adding Map keys during iteration repeat work?

    Iteration can visit entries added before it finishes.

  12. How do I avoid misparsing Turkish decimal commas in price inputs?

    Intl.NumberFormat formats but does not provide a general parser.

  13. Why does catch error.message fail after enabling strict TypeScript?

    JavaScript can throw any value, so the caught value is unknown.

  14. Why does Array.find return a possibly undefined record despite a known ID?

    The type system cannot guarantee the array contains that ID.

  15. Why does array[index] become possibly undefined after a compiler setting change?

    noUncheckedIndexedAccess accounts for out-of-range access.

  16. Why can I omit an optional property but not assign undefined to it?

    With exactOptionalPropertyTypes, absence differs from a present undefined value unless the type explicitly allows undefined.

  17. Why does Object.keys not produce keys safe for indexing my typed object?

    Runtime objects may contain keys beyond their static type.

  18. Why does config.mode require bracket access after stricter dictionary typing?

    The property is known only through an index signature.

  19. Why does an empty TypeScript array reject the first object pushed into it?

    Empty-array inference depends on context and can produce never[] in a generic initializer.

  20. How do I make a TypeScript switch fail compilation when a new status is added?

    Use a discriminated union and assign the remaining value to never in the default branch: const unreachable: never = state.

  21. Why does event.target.value fail in a TypeScript DOM handler?

    EventTarget is not necessarily an input, and bubbling can originate from descendants.

  22. How does satisfies validate configuration without widening every literal?

    On TypeScript 4.9+, use const config = {...} satisfies Config to check compatibility while retaining useful inferred detail.

  23. Why does a literal action type widen to string before dispatch?

    A mutable object property may be inferred as string.

  24. How do I preserve a literal tuple through a generic helper?

    On TypeScript 5.0+, a const type parameter can improve literal inference: function define<const T extends readonly string[]>(x:T){return x;}.

Ask your own question · Sign in to post questions and answers.