• 0 Posts
  • 16 Comments
Joined 2 months ago
cake
Cake day: October 28th, 2025

help-circle






  • velindora@lemmy.cafetoProgrammer Humor@programming.dev;DR blame the dev
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    4
    ·
    13 hours ago

    TypeScript’s type system exists only at compile time. When your code runs, it has been transpiled to plain JavaScript and all type information is erased, so TypeScript itself provides no runtime type safety.

    Any runtime safety must be added explicitly (e.g., manual checks, schema validators like Zod, io-ts, or runtime assertions), but that safety does not come from TypeScript itself.


  • velindora@lemmy.cafetoProgrammer Humor@programming.dev;DR blame the dev
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    2
    ·
    13 hours ago

    TypeScript’s type system exists only at compile time. When your code runs, it has been transpiled to plain JavaScript and all type information is erased, so TypeScript itself provides no runtime type safety.

    Any runtime safety must be added explicitly (e.g., manual checks, schema validators like Zod, io-ts, or runtime assertions), but that safety does not come from TypeScript itself.

    Downvote yourself please.