Suggest an editImprove this articleRefine the answer for “What does "strict typing" mean?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Strict typing** means a language **does not allow implicit (automatic) conversion of a value from one type to another** if that could lead to unexpected behavior. **Key point:** TypeScript requires you to explicitly respect types and not mix, for example, `string` and `number` without an explicit conversion.Shown above the full answer for quick recall.Answer (EN)Image**Strict typing** means a language **does not allow implicit (automatic) conversion of a value from one type to another** if that could lead to unexpected behavior. Simply put, **TypeScript requires you to explicitly respect types** and not mix, for example, `string` and `number` without an explicit conversion. --- ### 1. Example of "loose" typing (JavaScript) JavaScript is a **dynamically and weakly typed** language, so it will *try on its own* to convert types to the needed form: ```javascript console.log("5" - 1); // 4 ← the string "5" is implicitly converted to a number console.log("5" + 1); // "51" ← here, conversely, a number became a string console.log(true + 1); // 2 ``` > This behavior often causes **unpredictable errors**. --- ### 2. Example of strict typing (TypeScript) TypeScript is a **strictly typed** language. It does not allow "mixing" types without your permission: ```javascript let count: number = 5; count = "5"; // Error: type string is not assignable to type number console.log("5" - 1); // Error at compile time ``` If you still need to convert a type, do it **explicitly**: ```javascript let num = Number("5"); // Explicit conversion of a string to a number console.log(num - 1); // 4 ``` --- ### 3. Difference between "strict" and "weak" typing | Property | **Strict typing** | **Weak typing** | |---|---|---| | Type conversion | Only **explicit** | Often **implicit** | | Compatibility check | At compile time | At runtime | | Example languages | TypeScript, Java, C#, Rust | JavaScript, PHP, Python | | Behavior for "5" + 1 | Error | "51" | | Behavior for "5" - 1 | Error | 4 | --- ### 4. Why it matters Strict typing helps: - prevent **hidden bugs** and errors; - make code **predictable** and safe; - improve **long-term maintainability** and project scaling; - get **accurate IDE hints** and autocomplete. --- ### Summary > **Strict typing** is a principle by which a language **strictly controls type compatibility** > and **does not perform implicit conversions**, so the programmer always consciously manages data types.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.