Suggest an editImprove this articleRefine the answer for “What does "static typing" mean?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Static typing** means that the **data type of a variable, parameter, or expression is checked at compile time**, **before the program runs**. **Key point:** TypeScript "checks types ahead of time" instead of while the code is running.Shown above the full answer for quick recall.Answer (EN)Image**Static typing** means that the **data type of a variable, parameter, or expression is checked at compile time**, **before the program runs**. In simpler terms, TypeScript (or another statically typed language) **"checks types ahead of time"**, not while the code is running. --- ### 1. Example without static typing (JavaScript) ```javascript let name = "Alice"; name = 123; // allowed, JS does not check types console.log(name.toUpperCase()); // Runtime error ``` > In JavaScript the error appears **only when the program runs**, because the type of `name` is not fixed. --- ### 2. Example with static typing (TypeScript) ```javascript let name: string = "Alice"; name = 123; // Compile error: string expected ``` > TypeScript reports the error **before the code even runs**, preventing bugs in advance. > The compiler simply will not let you build a project with such a type mismatch. --- ### 3. The main idea With static typing: - types are **known ahead of time** (at compile time); - **type errors are caught before the program runs**; - the IDE and compiler can provide **hints, autocomplete, and navigation**. --- ### 4. The opposite: dynamic typing | Approach | When types are checked | Example languages | Example error | |---|---|---|---| | **Static typing** | at compile time | TypeScript, Java, C# | Error: "expected string, got number" | | **Dynamic typing** | at runtime | JavaScript, Python | Error while the program runs | --- ### 5. Advantages of static typing - Early error detection - Convenient IDE hints - Better readability and predictability of code - Safe refactoring and scaling of the project --- ### In short: > **Static typing** is a mechanism that **guarantees type correctness before the program runs**, > helping avoid many errors already at the development stage.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.